Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qdoc-manual-qdocconf.qdoc
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5 \page 21-0-qdoc-configuration.html
6 \previouspage Miscellaneous Macros
7 \nextpage Generic Configuration Variables
8
9 \title The QDoc Configuration File
10
11 Before running QDoc, you must create a QDoc configuration file to
12 tell QDoc where to find the source files that contain the QDoc
13 comments. The pathname to your configuration file is passed to
14 QDoc on the command line:
15
16 \quotation
17 \c {/current/dir$ ../../bin/qdoc ./config.qdocconf}
18 \endquotation
19
20 \section1 General Description
21
22 The configuration file is a list of entries of the form \e
23 {"variable = value"}. Using the configuration variables, you can
24 define where QDoc should find the various source files, images and
25 examples, where to put generated documentation etc. The
26 configuration file can also contain directives like \c
27 include. For an example, see \l minimum.qdocconf.
28
29 You can also use configuration variables to get QDoc to support
30 \l{Supporting Derived Projects} {derived projects}, i.e QDoc can
31 generate links in your project's documentation to elements in the
32 Qt online documentation. See the \l {Supporting Derived projects}
33 section.
34
35 A valid configuration variable name can include upper and lower case
36 letters, numbers, and an underscore, '_'.
37
38 The value of a configuration variable can be set using either '='
39 or '+='. The difference is that '=' overrides the previous value,
40 while '+=' adds a new value to the current one.
41
42 Values of some configuration variables are interpreted as a list of
43 strings, for example:
44 \l {sourcedirs-variable}
45 {\c{sourcedirs}}, while others are treated as a single string. Double
46 quotes around a value string are optional, but including them allows
47 you to use special characters like '=' and ' \" ' within the value
48 string, for example:
49
50 \badcode
51 HTML.postheader = "<ul class=\"breadcrumbs\">"
52 \endcode
53
54 If an entry spans many lines, use a backslash at the end of every
55 line but the last:
56
57 \badcode
58 sourcedirs = kernel tools widgets
59 \endcode
60
61 This can be written as:
62 \badcode
63 sourcedirs = kernel \
64 tools \
65 widgets
66 \endcode
67
68 If a value spans multiple lines but is interpreted as a single string,
69 the lines are joined with spaces.
70
71 \section1 Expansion of Configuration Values
72
73 QDoc supports expanding environment variables within configuration files.
74 For example, Qt modules rely on the environment variable QT_INSTALL_DOCS
75 to include definitions related to all Qt module documentation projects:
76
77 \badcode
78 include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
79 \endcode
80
81 A variable to expand is prefixed with '$'. To use the literal character
82 '$' within a value string, escape it with a backslash: '\\$'.
83
84 Since QDoc 6.0, values can be expanded also from other configuration
85 variables. In addition to the \c {$variable} syntax, also \c {${variable}}
86 is valid. The latter eliminates the need to separate the variable
87 name with whitespace or non-variable characters. For example:
88
89 \badcode
90 baseurl = https://doc.qt.io/
91 ...
92 url = ${baseurl}qtcreator
93 \endcode
94
95 If the target variable refers to a list of strings, they will be
96 joined using spaces in the expanded value:
97
98 \badcode
99 vars = foo \
100 bar \
101 baz
102
103 items = "Items: $vars" # Expands to "Items: foo bar baz"
104 \endcode
105
106 Controlling which character is used for joining the string list is also
107 possible:
108
109 \badcode
110 items = "Items: ${vars,|}" # Expands to "Items: foo|bar|baz"
111 items = "Items: ${vars,,}" # Expands to "Items: foo,bar,baz"
112 items = "Items: ${vars,}" # Expands to "Items: foobarbaz"
113 \endcode
114
115 As the expansion is performed after reading in all variables, the order
116 in which they are defined does not matter.
117
118 \note Nested variable expansion is not supported.
119
120 \section2 Expanding Environment Variables
121
122 When expanding environment variables, the \c {${variable}} syntax has
123 different behavior compared to \c {$variable}. The former expands the
124 content of the variable in place to be parsed as part of the
125 configuration file, while the latter simply assigns the content as a
126 value for the current configuration variable. This has implications if
127 the environment variable contains a list of elements separated by
128 whitespace, or other formatting recognized by QDoc.
129
130 For example, if the value of an environment variable \c SRCDIRS is
131 \c {"../src/a ../src/b"}, then
132
133 \badcode
134 sourcedirs = $SRCDIRS # Fail - value is interpreted as a single path.
135 sourcedirs = ${SRCDIRS} # Ok - whitespace is used as a delimiter.
136 \endcode
137
138 \section1 Configuration Variables
139
140 \section2 Variable List
141
142 \list
143 \li \l {defines-variable} {defines}
144 \li \l {depends-variable} {depends}
145 \li \l {documentationinheaders-variable} {documentationinheaders}
146 \li \l {exampledirs-variable} {exampledirs}
147 \li \l {examples-variable} {examples}
148 \li \l {examplesinstallpath-variable} {examplesinstallpath}
149 \li \l {examples.fileextensions-variable} {examples.fileextensions}
150 \li \l {examples.warnaboutmissingimages-variable} {examples.warnaboutmissingimages}
151 \li \l {examples.warnaboutmissingprojectfiles-variable} {examples.warnaboutmissingprojectfiles}
152 \li \l {excludedirs-variable} {excludedirs}
153 \li \l {excludefiles-variable} {excludefiles}
154 \li \l {extraimages-variable} {extraimages}
155 \li \l {falsehoods-variable} {falsehoods}
156 \li \l {headerdirs-variable} {headerdirs}
157 \li \l {headers-variable} {headers}
158 \li \l {headers.fileextensions-variable} {headers.fileextensions}
159 \li \l {HTML.footer-variable} {HTML.footer}
160 \li \l {HTML.postheader-variable} {HTML.postheader}
161 \li \l {HTML.postpostheader-variable} {HTML.postpostheader}
162 \li \l {HTML.style-variable} {HTML.style}
163 \li \l {includepaths-variable} {includepaths}
164 \li \l {includeprivate-variable} {includeprivate}
165 \li \l {ignorewords-variable} {ignorewords}
166 \li \l {ignoresince-variable} {ignoresince}
167 \li \l {imagedirs-variable} {imagedirs}
168 \li \l {imagesoutputdir-variable} {imagesoutputdir}
169 \li \l {indexes-variable} {indexes}
170 \li \l {language-variable} {language}
171 \li \l {locationinfo-variable} {locationinfo}
172 \li \l {logwarnings-variable} {logwarnings}
173 \li \l {macro-variable} {macro}
174 \li \l {manifestmeta-variable} {manifestmeta}
175 \li \l {moduleheader-variable} {moduleheader}
176 \li \l {navigation-variable} {navigation}
177 \li \l {outputdir-variable} {outputdir}
178 \li \l {outputformats-variable} {outputformats}
179 \li \l {outputprefixes-variable} {outputprefixes}
180 \li \l {outputsuffixes-variable} {outputsuffixes}
181 \li \l {parsecppcomments-variable} {parsecppcomments}
182 \li \l {preliminary-variable} {preliminary}
183 \li \l {productname-variable} {productname}
184 \li \l {project-variable} {project}
185 \li \l {projectroot-variable} {projectroot}
186 \li \l {showautogenerateddocs-variable} {showautogenerateddocs}
187 \li \l {sourcedirs-variable} {sourcedirs}
188 \li \l {sources-variable} {sources}
189 \li \l {sources.fileextensions-variable} {sources.fileextensions}
190 \li \l {spurious-variable} {spurious}
191 \li \l {tabsize-variable} {tabsize}
192 \li \l {url-variable} {url}
193 \li \l {url.examples-variable} {url.examples}
194 \li \l {url.sources-variable} {url.sources}
195 \li \l {usealttextastitle-variable} {usealttextastitle}
196 \li \l {version-variable} {version}
197 \li \l {versionsym-variable} {versionsym}
198 \li \l {warninglimit-variable} {warninglimit}
199 \endlist
200
201 \section2 Categories
202
203 \list
204 \li \l {Generic Configuration Variables}
205 \li \l {Format-specific Configuration Variables}
206 \endlist
207
208 \section1 Configuration File Examples
209
210 \list
211 \li A minimum configuration file: \l minimum.qdocconf
212 \li The Qt configuration file: \l qtgui.qdocconf
213 \endlist
214*/
215
216
217/*!
218 \page 22-qdoc-configuration-generalvariables.html
219 \previouspage The QDoc Configuration File
220 \nextpage Creating Help Project Files
221
222 \title Generic Configuration Variables
223
224 With the general QDoc configuration variables, you can define
225 where QDoc will find the various source files it needs to generate
226 the documentation, as well as the directory to put the generated
227 documentation. You can also do some minor manipulation of QDoc
228 itself, controlling its output and processing behavior.
229
230 \target codeindent-variable
231 \section1 codeindent
232
233 The \c codeindent variable specifies the level of indentation that
234 QDoc uses when writing code snippets.
235
236 QDoc originally used a hard-coded value of four spaces for code
237 indentation to ensure that code snippets could be easily
238 distinguished from surrounding text. Since we can use \l{HTML
239 Specific Configuration Variables#HTML.stylesheets} {stylesheets}
240 to adjust the appearance of certain types of HTML elements, this
241 level of indentation is not always required.
242
243 \target codelanguages-variable
244 \section1 codelanguages
245
246 The \c codelanguages variable specifies a list of source code languages
247 not recognized by QDoc that can be used within \\code ... \\endcode
248 blocks. This enables blocks of code to be written in languages that
249 QDoc cannot parse, and HTML to be generated that can be highlighted
250 or processed by other tools.
251
252 \code [text]
253 codelanguages = Python Rust Java Swift "C#"
254 \endcode
255
256 Since QDoc can handle C++ (Cpp), QML and text, these languages do
257 not need to be specified in this list. Language names containing
258 special characters, such as C#, need to be quoted with double quotes
259 when included in this list.
260
261 The \c codelanguages variable was introduced in QDoc 6.11 to enable
262 online Qt documentation to use syntax highlighting for a subset of
263 the \l{languages supported by highlight.js}.
264
265 See also \l {code-command}{\\code}.
266
267 \target codeprefix-variable
268 \target codesuffix-variable
269 \section1 codeprefix, codesuffix
270
271 The \c codeprefix and \c codesuffix variables specify a pair of
272 strings that each code snippet is enclosed in.
273
274 \target defines-variable
275 \section1 defines
276
277 The \c defines variable specifies the C++ preprocessor symbols
278 that QDoc will recognize and respond to.
279
280 When a preprocessor symbol is specified using the \c defines
281 variable, you can also use the \l {if-command} {\\if} command to
282 enclose documentation that only will be included if the
283 preprocessor symbol is defined.
284
285 \badcode
286 defines = QT_GUI_LIB
287 \endcode
288
289 This ensures that QDoc will process the code that requires these
290 symbols to be defined. For example:
291
292 \code
293 #ifdef Q_GUI_LIB
294 void keyClick(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1)
295 #endif
296 \endcode
297
298
299 You can also define preprocessor symbols manually on the command
300 line using the -D option. For example:
301
302 \badcode
303 currentdirectory$ qdoc -Dqtforpython qtgui.qdocconf
304 \endcode
305
306 In this case the -D option ensures that the \c qtforpython
307 preprocessor symbol is defined when QDoc processes the source
308 files defined in the qtgui.qdocconf file.
309
310 See also \l {falsehoods-variable} {falsehoods} and \l {if-command} {\\if}.
311
312 \target depends-variable
313 \section1 depends
314
315 The \c depends variable defines a list of other documentation projects
316 that this project depends on for resolving link targets for type
317 inheritance and anything else the documentation needs to link to.
318
319 Like Qt itself, documentation for Qt is distributed across multiple
320 modules. In a multi-module documentation project, the minimum set
321 of dependencies for a single module consists of actual build
322 dependencies. In addition, if there is a documentation project
323 (module) that acts as a top-level entry point for the entire
324 documentation set and provides \l {navigation-variable}{navigation}
325 links, each module documentation should include it as a dependency.
326
327 When QDoc generates documentation for a project, it will also generate
328 an \c .index file containing URLs to each linkable entity in the project.
329 Each dependency is a (lowercase) name of a project. This name must
330 match with the base name of the index file generated for that
331 project.
332
333 \badcode
334 depends = \
335 qtdoc \
336 qtcore \
337 qtquick
338 \endcode
339
340 When invoking QDoc on a project that has dependencies and uses the
341 \c depends variable, one or more \c --indexdir path(s) must be passed
342 as command line option(s). QDoc uses these paths to search for
343 the dependencies' index files.
344
345 \badcode
346 qdoc mydoc.qdocconf --outputdir $PWD/html --indexdir $QT_INSTALL_DOCS
347 \endcode
348
349 With above, QDoc will search for a file
350 \c {$QT_INSTALL_DOCS/qtdoc/qtdoc.index} for a dependency to \c qtdoc.
351 If an index file for a dependency is not found, QDoc will output a
352 warning.
353
354 The \c depends command accepts also a special value of '*'. This
355 instructs QDoc to load all index files found in specified index
356 directories; that is, "depends on everything".
357
358 \badcode
359 depends = *
360 \endcode
361
362 See also \l{indexes-variable}{indexes}, \l{project-variable}{project}, and
363 \l{url-variable}{url}.
364
365 \target documentationinheaders-variable
366 \section1 documentationinheaders
367
368 Set \c {documentationinheaders = true} to instruct QDoc to parse
369 documentation comments also in header files when generating
370 documentation for C++-based projects.
371
372 \warning In large code bases, this may impact QDoc's processing time.
373 Therefore, you shouldn't set this flag unless you need it.
374
375 This feature was introduced to QDoc with Qt 6.9.
376
377 \target exampledirs-variable
378 \section1 exampledirs
379
380 The \c exampledirs variable specifies the directories containing
381 the source code of the example files.
382
383 The \l {examples-variable} {examples} and \l
384 {exampledirs-variable} {exampledirs} variables are used by the \l
385 {quotefromfile-command} {\\quotefromfile}, \l {quotefile-command}
386 {\\quotefile} and \l {example-command} {\\example} commands. If
387 both the \l {examples-variable} {examples} and \l
388 {exampledirs-variable} {exampledirs} variables are defined, QDoc
389 will search in both, first in \l {examples-variable} {examples}
390 then in \l {exampledirs-variable} {exampledirs}.
391
392 QDoc will search through the directories in the specified order,
393 and accept the first matching file it finds. It will only search
394 in the specified directories, \e not in subdirectories.
395
396 \badcode
397 exampledirs = $QTDIR/doc/src \
398 $QTDIR/examples \
399 $QTDIR \
400 $QTDIR/qmake/examples
401
402 examples = $QTDIR/examples/widgets/analogclock/analogclock.cpp
403 \endcode
404
405 When processing
406
407 \badcode
408 \quotefromfile widgets/calculator/calculator.cpp
409 \endcode
410
411 QDoc will see if there is a file called \c calculator.cpp
412 listed as a value in the \l {examples-variable} {\c examples} variable. If
413 there isn't, it will search in the \c exampledirs variable, and
414 first see if there exists a file called
415
416 \badcode
417 $QTDIR/doc/src/widgets/calculator/calculator.cpp
418 \endcode
419
420 If it doesn't, QDoc will continue looking for a file called
421
422 \badcode
423 $QTDIR/examples/widgets/calculator/calculator.cpp
424 \endcode
425
426 and so forth.
427
428 See also \l {examples-variable}{examples}.
429
430 \target examples-variable
431 \section1 examples
432
433 The \c examples variable allows you to specify individual example
434 files in addition to those located in the directories specified by
435 the \l {exampledirs-variable} {\c exampledirs} variable.
436
437 The \c examples and \l {exampledirs-variable} {\c exampledirs}
438 variables are used by the \l {quotefromfile-command}
439 {\\quotefromfile}, \l {quotefile-command} {\\quotefile} and \l
440 {example-command} {\\example} commands. If both the \c examples and \l
441 {exampledirs-variable} {\c exampledirs} variables are defined,
442 QDoc will search in both, first in \c examples then in \l
443 {exampledirs-variable} {\c exampledirs}.
444
445 QDoc will search through the values listed for the \c examples
446 variable, in the specified order, and accept the first one it
447 finds.
448
449 For an extensive example, see the \l {exampledirs-variable} {\c
450 exampledirs} command. But note that if you know the file is listed
451 in the \c examples variable, you don't need to specify its path:
452
453 \badcode
454 \quotefromfile calculator.cpp
455 \endcode
456
457 See also \l {exampledirs-variable} {exampledirs}.
458
459 \target examplesinstallpath-variable
460 \section1 examplesinstallpath
461
462 The \c examplesinstallpath variable sets the root path for this
463 project's examples under the \e installed example directory.
464
465 Assuming a root install path of \c QT_INSTALL_EXAMPLES for all
466 examples, then the path
467
468 \badcode
469 <QT_INSTALL_EXAMPLES>/<examplesinstallpath>/<example_path>
470 \endcode
471
472 will be used to refer to a path of a single example within this
473 documentation project. These paths are recorded in the
474 \l {Example Manifest Files} {example manifest file}, read by Qt
475 Creator.
476
477 To ensure correct paths, \c examplesinstallpath must match with
478 one of the directories listed in \l {exampledirs-variable}
479 {exampledirs}. The path passed as an argument for each
480 \l {example-command} {\\example} command is relative to
481 the path in \e exampledirs.
482
483 For example:
484
485 \badcode
486 exampledirs = ./snippets \
487 ../../../examples/mymodule
488
489 examplesinstallpath = mymodule
490 \endcode
491
492 And given a following \\example command:
493
494 \badcode *
495 /*!
496 \example basic/hello
497 ...
498 \1/
499 \endcode
500
501 Then, the path \c {mymodule/basic/hello} is recorded in the manifest file
502 for this example.
503
504 \note It is possible to override \c examplesinstallpath for an individual
505 \l {example-command}{\\example} using the \l {meta-command}{\\meta}
506 command.
507
508 \b {See also}: \l {exampledirs}, \l {example-command} {\\example}, and
509 \l {meta-command}{\\meta}.
510
511 \target examples.fileextensions-variable
512 \section1 examples.fileextensions
513
514 The \c examples.fileextensions variable specifies the file
515 extensions that QDoc will look for when collecting example files
516 for display in the documentation.
517
518 The default extensions are *.cpp, *.h, *.js, *.xq, *.svg, *.xml
519 and *.ui.
520
521 The extensions are given as standard wildcard expressions. You
522 can add a file extension to the filter using '+='. For example:
523
524 \badcode
525 examples.fileextensions += *.qrc
526 \endcode
527
528 See also \l{headers.fileextensions}.
529
530 \target examples.warnaboutmissingimages-variable
531 \section1 examples.warnaboutmissingimages
532
533 While processing example documentation, QDoc may emit warnings if an example
534 doesn't contain any images. This warning can be disabled by setting the
535 following configuration variable in the .qdocconf file for the project:
536
537 \c {examples.warnaboutmissingimages = false}
538
539 This configuration variable was introduced to QDoc with Qt 6.9.
540
541 See also \l{examples.warnaboutmissingprojectfiles-variable}
542 {examples.warnaboutmissingprojectfiles}.
543
544 \target examples.warnaboutmissingprojectfiles-variable
545 \section1 examples.warnaboutmissingprojectfiles
546
547 While processing example documentation, QDoc may emit warnings if an example
548 doesn't contain a project file. This warning can be disabled by setting the
549 following configuration variable in the .qdocconf file for the project:
550
551 \c {examples.warnaboutmissingprojectfiles = false}
552
553 This configuration variable was introduced to QDoc with Qt 6.9.
554
555 See also \l{examples.warnaboutmissingimages-variable}
556 {examples.warnaboutmissingimages}.
557
558 \target excludedirs-variable
559 \section1 excludedirs
560
561 The \c excludedirs variable is for listing directories that should \e{not}
562 be processed by QDoc, even if the same directories are included by the
563 \l {sourcedirs-variable} {sourcedirs} or \l {headerdirs-variable} {headerdirs}
564 variables.
565
566 For example:
567
568 \badcode
569 sourcedirs = src/corelib
570 excludedirs = src/corelib/tmp
571 \endcode
572
573 When executed, QDoc will exclude the listed directories from
574 further consideration. Files in these directories will not be
575 read by QDoc.
576
577 See also \l {excludefiles-variable} {excludefiles}.
578
579 \target excludefiles-variable
580 \section1 excludefiles
581
582 The \c excludefiles variable allows you to specify individual files
583 that should \e{not} be processed by QDoc.
584
585 \badcode
586 excludefiles += $QT_CORE_SOURCES/../../src/widgets/kernel/qwidget.h \
587 $QT_CORE_SOURCES/../../src/widgets/kernel/qwidget.cpp
588 \endcode
589
590 If you include the above in your qdocconf file for qtbase, there
591 will be no class documentation generated for QWidget.
592
593 Since Qt 5.6, also simple wildcards ('*' and '?') are recognized by
594 \c excludefiles. For example, to exclude all private Qt header files
595 from being parsed, define the following:
596
597 \badcode
598 excludefiles += "*_p.h"
599 \endcode
600
601 See also \l {excludedirs-variable} {excludedirs}.
602
603 \target extraimages-variable
604 \section1 extraimages
605
606 The \c extraimages variable tells QDoc to incorporate specific
607 images in the generated documentation.
608
609 QDoc automatically copies an image file from \l imagedirs to the output
610 directory if it's referenced by the \l {image-command} {\c{\image}} or
611 \l {inlineimage-command} {\c{\inlineimage}} command. If you want to copy
612 additional images, you must specify them using the \c extraimages variable.
613
614 The general syntax is \tt {\e{format}.extraimages = \e image}.
615
616 Example:
617 \badcode
618 HTML.extraimages = images/qt-logo.png
619 \endcode
620
621 See also \l images and \l imagedirs.
622
623 \target falsehoods-variable
624 \section1 falsehoods
625
626 The \c falsehoods variable defines the truth value of specified
627 preprocessor symbols as false.
628
629 The values of the variable are regular expressions (see QRegularExpression
630 for details). If this variable is not set for a preprocessor
631 symbol, QDoc assumes its truth value is true. The exception is
632 '0', which is always false.
633
634 QDoc will recognize, and is able to evaluate, the following
635 preprocessor syntax:
636
637 \code
638 #ifdef NOTYET
639 ...
640 #endif
641
642 #if defined (NOTYET)
643 ...
644 #end if
645 \endcode
646
647 However, faced with unknown syntax like
648
649 \code
650 #if NOTYET
651 ...
652 #endif
653 \endcode
654
655 QDoc will evaluate it as true by default, \e unless the
656 preprocessor symbol is specified within the \c falsehoods variable
657 entry:
658
659 \badcode
660 falsehoods = NOTYET
661 \endcode
662
663 See also \l defines.
664
665 \target generateindex-variable
666 \section1 generateindex
667
668 The \c generateindex variable contains a boolean value that
669 specifies whether to generate an index file when HTML
670 documentation is generated.
671
672 By default, an index file is always generated with HTML
673 documentation, so this variable is typically only used when
674 disabling this feature (by setting the value to \c false) or when
675 enabling index generation for the WebXML output (by setting the
676 value to \c true).
677
678 \target headerdirs-variable
679 \section1 headerdirs
680
681 The \c headerdirs variable specifies the directories containing
682 the header files associated with the \c .cpp source files used in
683 the documentation.
684
685 \badcode
686 headerdirs = $QTDIR/src \
687 $QTDIR/extensions/activeqt \
688 $QTDIR/extensions/motif \
689 $QTDIR/tools/designer/src/lib/extension \
690 $QTDIR/tools/designer/src/lib/sdk \
691 $QTDIR/tools/designer/src/lib/uilib
692 \endcode
693
694 When executed, the first thing QDoc will do is to read through the
695 headers specified in the \l {headers} {\c headers} variable, and
696 the ones located in the directories specified in the \c headerdir
697 variable (including all subdirectories), building an internal
698 structure of the classes and their functions.
699
700 Then it will read through the sources specified in the \l
701 {sources-variable} {\c sources}, and the ones located in the
702 directories specified in the \l {sourcedirs-variable} {\c
703 sourcedirs} varible (including all subdirectories), merging the
704 documentation with the structure it retrieved from the header
705 files.
706
707 If both the \c headers and \c headerdirs variables are defined,
708 QDoc will read through both, first \l {headers} {\c headers} then
709 \c headerdirs.
710
711 In the specified directories, QDoc will only read the files with
712 the \c fileextensions specified in the \l {headers.fileextensions}
713 {\c headers.fileextensions} variable. The files specified by
714 \l {headers} {\c headers} will be read without taking into account
715 their fileextensions.
716
717 QDoc finds new header files in these directories, and in any of
718 their subdirectories, on its own. You only need to list a header in
719 \l {headers} {\c headers} if it's outside the header directories,
720 or if its extension isn't in \c headers.fileextensions. The
721 \l {excludedirs-variable} {excludedirs} and
722 \l {excludefiles-variable} {excludefiles} variables exclude files
723 from the header directories.
724
725 See also \l headers and \l headers.fileextensions.
726
727 \target headers-variable
728 \section1 headers
729
730 The \c headers variable allows you to specify individual header
731 files in addition to those located in the directories specified by
732 the \l {headerdirs} {\c headerdirs} variable.
733
734 \badcode
735 headers = $QTDIR/src/gui/widgets/qlineedit.h \
736 $QTDIR/src/gui/widgets/qpushbutton.h
737 \endcode
738
739 When processing the \c headers variable, QDoc behaves in the same
740 way as it does when processing the \l {headerdirs} {\c headerdirs}
741 variable. For more information, see the \l {headerdirs} {\c
742 headerdirs} variable.
743
744 See also \l headerdirs.
745
746 \target headers.fileextensions-variable
747 \section1 headers.fileextensions
748
749 The \c headers.fileextensions variable specify the extension used
750 by the headers.
751
752 When processing the header files specified in the \l {headerdirs}
753 {\c headerdirs} variable, QDoc will only read the files with the
754 fileextensions specified in the \c headers.fileextensions
755 variable. In this way QDoc avoids spending time reading irrelevant
756 files.
757
758 The default extensions are *.ch, *.h, *.h++, *.hh, *.hpp, and
759 *.hxx.
760
761 The extensions are given as standard wildcard expressions. You
762 can add a file extension to the filter using '+='. For example:
763
764 \badcode
765 header.fileextensions += *.H
766 \endcode
767
768 \warning The above assignment may not work as described.
769
770 See also \l headerdirs.
771
772 \target includepaths-variable
773 \section1 includepaths
774
775 The \c includepaths variable is used for passing additional
776 include paths to the Clang parser that QDoc uses for parsing C++
777 code for documentation comments.
778
779 The variable accepts a list of paths, prefixed with \c{-I} (include
780 path), \c {-F} (\macos framework include path), or \c{-isystem}
781 (system include path). If a prefix is omitted, \c{-I} is used by
782 default.
783
784 Paths relative to the current .qdocconf file are resolved into
785 absolute paths. Paths that do not exist in the file system are
786 ignored.
787
788 \note For Qt documentation projects, the build system typically
789 provides the required include paths as command line
790 arguments when invoking QDoc.
791
792 See also \l moduleheader.
793
794 \target includeprivate-variable
795 \section1 includeprivate
796
797 Use \c includeprivate to include private C++ class members in your
798 documentation. QDoc normally excludes private functions, types, and
799 variables from generated documentation.
800
801 To include all private members, set \c includeprivate to \c true:
802
803 \badcode
804 includeprivate = true
805 \endcode
806
807 You can also enable specific member types:
808
809 \badcode
810 # Include only private functions
811 includeprivate.functions = true
812
813 # Include only private types (classes, enums, typedefs)
814 includeprivate.types = true
815
816 # Include only private variables
817 includeprivate.variables = true
818 \endcode
819
820 Specific settings override the global setting. For example:
821
822 \badcode
823 includeprivate = true
824 includeprivate.types = false
825 \endcode
826
827 This configuration includes private functions and variables but
828 excludes private types.
829
830 \note Document private members only when you need to explain internal
831 APIs and implementation details. Avoid exposing implementation
832 details that users don't need.
833
834 QDoc introduced \c includeprivate in Qt 6.11.
835
836 \target internalfilepatterns-variable
837 \section1 internalfilepatterns
838
839 The \c internalfilepatterns variable specifies file path patterns that
840 identify internal implementation files. \b{Classes} declared in files
841 matching these patterns are automatically marked as Internal, along with all
842 their members (properties, functions, enums, nested types). Free functions,
843 enums, and typedefs at file scope are not affected by this setting.
844
845 When showinternal is \c false (the default), these entities are excluded
846 from documentation validation. When \c showinternal is \c true, they are
847 included in the documentation but retain their Internal status, allowing
848 generators to style them differently (such as adding visual indicators for
849 internal APIs).
850
851 This is useful for private implementation headers that contain classes not
852 part of the documented public interface. In Qt, this includes private
853 headers ending with \c {_p.h}.
854
855 \section2 Pattern Syntax
856 The patterns support two syntaxes:
857
858 \list
859 \li \b{Shell-style glob patterns}: Simple wildcards where \c{*} matches any
860 characters and \c{?} matches exactly one character. \b{Glob patterns are
861 matched against the filename only}, not the full path, making them ideal
862 for patterns such as \c{*_p.h}.
863 \li \b{Regular expressions}: For path-based matching, use regex syntax. Any
864 pattern containing regex metacharacters (\c{^$[]{}()|+\\.}) is treated
865 as a regular expression and matched against the full normalized file
866 path.
867 \endlist
868
869 Patterns are matched with forward slashes (\c{/}) as directory separators.
870 QDoc normalizes path separators internally, so always use \c{/} in patterns
871 regardless of platform.
872
873 When a class is marked as Internal due to its file location, the Internal
874 status automatically propagates to all its members through the node
875 hierarchy.
876
877 \b{Example - Qt Convention (glob):}
878 \badcode
879 internalfilepatterns = *_p.h
880 \endcode
881 Matches any file ending with \c{_p.h} at any directory depth.
882
883 \b{Example - Multiple Filename Patterns (glob):}
884 \badcode
885 internalfilepatterns = *_p.h *_impl.h *_pch.h
886 \endcode
887 Matches files ending with \c{_p.h}, \c{_impl.h}, or \c{_pch.h}.
888
889 \note Glob patterns will \b{not} work for directory matching, as globs only
890 see the filename. For directory-based patterns, use regex instead.
891
892 \b{Example - Directory-Based Match (regex):}
893 \badcode *
894 internalfilepatterns = .\1/internal/.\1\.h
895 \endcode
896 Matches any \c{.h} file in any \c{internal} directory at any depth.
897
898 \b{Example - Multiple Patterns:}
899 \badcode *
900 internalfilepatterns = *_p.h .\1/private/.\1\.h
901 \endcode
902 Combines glob patterns for simple cases with regex for complex paths.
903
904 QDoc introduced \c internalfilepatterns in Qt 6.11.
905
906 \b{See also:} \l{excludedirs-variable}{excludedirs} and
907 \l{excludefiles-variable}{excludefiles}.
908
909 \target ignorewords-variable
910 \section1 ignorewords
911
912 The \c ignorewords variable is used for specifying a list of strings
913 that QDoc will ignore when resolving hyperlink targets.
914
915 QDoc has an \l {qdoc-automatic-linking} {auto-linking feature}, where
916 linking is attempted for words that resemble C++ or QML entities.
917 Specifically, a string qualifies for auto-linking if it is at least
918 three characters in length, has no whitespace, and it
919
920 \list
921 \li is a \e camelCase word, that is, it contains at least one
922 uppercase character at index greater than zero, or
923 \li contains the substring \c {()} or \c {::}, or
924 \li contains at least one special character, \c {@} or \c {_}.
925 \endlist
926
927 Adding a qualified word to \c ignorewords stops QDoc from linking
928 that word automatically. For example, if the word \e OpenGL is a
929 valid link target (a section, \l{page-command}{\\page}, or
930 \l {externalpage-command}{\\externalpage} title), a hyperlink for
931 each occurrence can be avoided with
932
933 \badcode
934 ignorewords += OpenGL
935 \endcode
936
937 Linking explicitly with \l {l-command}{\\l} continues to work for
938 ignored words.
939
940 The \c ignorewords variable was introduced in QDoc 5.14.
941
942 \target ignoresince-variable
943 \section1 ignoresince
944
945 The \c ignoresince variable is used for setting a cutoff value for
946 versions passed to the \l {since-command}{\\since} command. All
947 \\since commands that define a version lower than the cutoff are
948 ignored and do not generate output.
949
950 The cutoff values are project-specific. The project name can be
951 defined as a subvariable. The default project name is \e Qt. For
952 example:
953
954 \badcode
955 ignoresince = 5.0
956 ignoresince.QDoc = 5.0
957 \endcode
958
959 These will ignore \\since commands where the major version is 4
960 or lower and the project is either \c QDoc or undefined.
961
962 \badcode
963 \since 3.2 # Ignored
964 \since 5.2 # Documented (as 'Qt 5.2')
965 \since QDoc 4.6 # Ignored
966 \since QtQuick 2.5 # Documented
967 \endcode
968
969 The \c ignoresince variable was introduced in QDoc 5.15.
970
971 See also \l {since-command}{\\since}.
972
973 \target imagedirs-variable
974 \section1 imagedirs
975
976 The \c imagedirs variable specifies the directories containing the
977 images used in the documentation.
978
979 The \l {images} {\c images} and \c imagedirs variables are used by
980 the \l {image-command} {\\image} and \l {inlineimage-command}
981 {\\inlineimage} commands. If both the \l {images} {\c images} and
982 \c imagedirs variables are defined, QDoc will search in both. First
983 in \l {images} {\c images}, then in \c imagedirs.
984
985 QDoc will search through the directories in the specified order,
986 and accept the first matching file it finds. It will only search
987 in the specified directories, \e not in subdirectories.
988
989 \badcode
990 imagedirs = $QTDIR/doc/src/images \
991 $QTDIR/examples
992
993 images = $QTDIR/doc/src/images/calculator-example.png
994 \endcode
995
996 When processing
997
998 \badcode
999 \image calculator-example.png
1000 \endcode
1001
1002 QDoc will then see if there is a file called
1003 calculator-example.png listed as a value in the \c images
1004 variable. If there isn't, it will search in the \c imagedirs
1005 variable for:
1006
1007 \badcode
1008 $QTDIR/doc/src/images/calculator-example.png
1009 \endcode
1010
1011 If the file doesn't exist, QDoc will look for a file called
1012
1013 \badcode
1014 $QTDIR/examples/calculator-example.png
1015 \endcode
1016
1017 \target imagesoutputdir-variable
1018 \section1 imagesoutputdir
1019
1020 The \c imagesoutputdir variable controls the name of the subdirectory,
1021 under the output directory, that QDoc uses to store images.
1022
1023 The default value for \c imagesoutputdir is \e images.
1024
1025 Image files passed as an argument to \qdoccmd {image} and
1026 \qdoccmd {inlineimage} commands are copied to this directory.
1027
1028 Setting a custom output directory for images is useful for multi-module
1029 documentation builds where multiple documentation projects are configured
1030 to use a shared output directory. For example, with the following (shared)
1031 configuration:
1032
1033 \badcode
1034 imagesoutputdir = images/${project}
1035 \endcode
1036
1037 Each documentation project in the build uses
1038 \c {<outputdir>/images/<project name>} to store images, thus avoiding
1039 identically-named image files overwriting each other.
1040
1041 This variable was introduced to QDoc with Qt 6.11.
1042
1043 \target language-variable
1044 \section1 language
1045
1046 The \c language variable specifies the language of the source code
1047 that is used in the documentation. Specifically, it defines the
1048 default language for parsing source code within \\code .. \\endcode
1049 blocks.
1050
1051 \badcode
1052 language = Cpp
1053 \endcode
1054
1055 The default language is C++ (Cpp), and doesn't need to be explicitly
1056 specified. If the code snippets in the documentation consist mainly
1057 of QML code, set QML as the default:
1058
1059 \badcode
1060 language = QML
1061 \endcode
1062
1063 See also \l {code-command}{\\code}.
1064
1065 \target locationinfo-variable
1066 \section1 locationinfo
1067
1068 The \c locationinfo boolean variable determines whether detailed
1069 location information about each entity is written to
1070 \c {.index}-files and \c {.webxml}-files (when using the WebXML
1071 output format).
1072
1073 Location information consists of the full path and line
1074 number of either the declaration or documentation comment block
1075 in the source code.
1076
1077 Setting this to \c false turns off location info:
1078
1079 \badcode
1080 locationinfo = false
1081 \endcode
1082
1083 The default value is \c true.
1084
1085 The \c locationinfo variable was introduced in QDoc 5.15.
1086
1087 \target logwarnings-variable
1088 \section1 logwarnings
1089
1090 The \c logwarnings boolean variable determines whether QDoc writes
1091 warning messages to a log file in addition to stderr.
1092
1093 When set to \c true, QDoc creates a log file named
1094 \c {<project>-qdoc-warnings.log} in the output directory and writes
1095 all warning messages to this file. Warnings are still also written
1096 to stderr as usual.
1097
1098 The log file includes a header with project information and, by default,
1099 the command-line arguments used to invoke QDoc for reproducibility.
1100
1101 Setting this to \c true enables warning logging:
1102
1103 \badcode
1104 logwarnings = true
1105 \endcode
1106
1107 The default value is \c false.
1108
1109 This feature is useful for large documentation sets or CI environments
1110 where warnings can be numerous and scroll by too quickly to be analyzed
1111 systematically.
1112
1113 The \c logwarnings variable was introduced in QDoc 6.11.
1114
1115 \section2 logwarnings.disablecliargs
1116
1117 The \c logwarnings.disablecliargs boolean sub-variable controls whether
1118 CLI arguments are omitted from warning log file headers.
1119
1120 \badcode
1121 logwarnings.disablecliargs = true
1122 \endcode
1123
1124 When set to \c true, the command-line arguments are omitted from the log
1125 file header, making the log files portable across different environments.
1126 This is useful for test suites and CI systems where command-line arguments
1127 contain environment-specific paths and temporary directories.
1128
1129 The default value is \c false.
1130 The \c {logwarnings.disablecliargs} variable was introduced in QDoc 6.11.
1131
1132
1133 \target macro-variable
1134 \section1 macro
1135
1136 The \c macro variable is used to create your own simple QDoc
1137 commands. The syntax is \tt {macro.\e{command} = \e{definition}}.
1138 \e command is limited to a combination of letter and number
1139 characters, but no special characters like dash or underscore.
1140 \e definition is written using QDoc syntax.
1141
1142 A macro variable can be restricted for use in one type of output
1143 generation. By appending \c {.HTML} to the macro name, for
1144 example, the macro is only used when generating HTML output.
1145
1146 \badcode
1147 macro.key = "\\b"
1148 macro.raisedaster.HTML = "<sup>*</sup>"
1149 \endcode
1150
1151 The first macro defines the \\key command to render its argument
1152 using a bold font. The second macro defines the \\raisedaster
1153 command to render a superscript asterisk, but only when generating
1154 HTML.
1155
1156 A macro can also take up to seven parameters:
1157
1158 \badcode
1159 macro.hello = "Hello \1!"
1160 \endcode
1161
1162 Parameters are passed to macros the same way as to other commands:
1163
1164 \badcode
1165 \hello World
1166 \endcode
1167
1168 When using more than one parameter, or when an argument
1169 contains whitespace, enclose each argument in braces:
1170
1171 \badcode
1172 macro.verinfo = "\1 (version \2)"
1173 \endcode
1174
1175 \badcode
1176 \verinfo {QFooBar} {1.0 beta}
1177 \endcode
1178
1179 A special macro option, \e match, can be added for additional
1180 regular expression pattern matching for expanded macros.
1181
1182 For example,
1183
1184 \badcode
1185 macro.qtminorversion = "$QT_VER"
1186 macro.qtminorversion.match = "\\d+\\.(\\d+)"
1187 \endcode
1188
1189 This creates a macro \\qtminorversion that expands to the minor
1190 version based on the QT_VER environment variable.
1191
1192 A macro that defines a match pattern outputs all capture groups
1193 (parentheses) concatenated together, or the exact matched string
1194 if the pattern does not contain any capture groups.
1195
1196 For more information about pre-defined macros, see \l {Macros}.
1197
1198 \target manifestmeta-variable
1199 \section1 manifestmeta
1200
1201 The \c manifestmeta variable specifies additional meta-content
1202 for the example manifest files generated by QDoc.
1203
1204 See the \l{Manifest Meta Content} section for more information.
1205
1206 \target moduleheader-variable
1207 \section1 moduleheader
1208
1209 The \c moduleheader variable defines the name of the module
1210 header of a documented C++ module.
1211
1212 Projects that document C++ APIs require a module-level header
1213 that includes all public classes, namespaces and header files
1214 for the module. The Clang parser in QDoc uses this file to
1215 build a pre-compiled header (PCH) for the module to increase
1216 the speed of parsing source files.
1217
1218 By default, the \l{project-variable}{project} name is used
1219 also as the module header name.
1220
1221 \badcode
1222 project = QtCore
1223 \endcode
1224
1225 With the above project name, QDoc searches a module header
1226 \e QtCore in all known include paths; first using the paths
1227 passed as command line arguments, then the paths listed in
1228 the \l includepaths variable.
1229
1230 QDoc will issue a warning if the module header is not found.
1231 It will then attempt to build an artificial module header
1232 based on the headers listed in the \l {headerdirs-variable}
1233 {headerdirs} variable.
1234
1235 For Qt documentation projects, the build system typically
1236 provides QDoc with correct include paths to locate the
1237 module header, provided that the \c project variable is set
1238 correctly. The \c moduleheader variable provides an
1239 alternative file name for QDoc to search for.
1240
1241 For projects that contain no C++ documentation, use the
1242 \qdocvar {parsecppcomments} variable to disable
1243 C++ parsing. Setting \c moduleheader to an empty string has the same
1244 effect, and is supported for backwards compatibility:
1245
1246 \badcode
1247 # No C++ code to document in this project
1248 moduleheader =
1249 \endcode
1250
1251 See also \qdocvar {parsecppcomments}, \l includepaths, and \l project.
1252
1253 \target naturallanguage-variable
1254 \section1 naturallanguage
1255
1256 The \c naturallanguage variable specifies the natural language
1257 used for the documentation generated by QDoc.
1258
1259 \badcode
1260 naturallanguage = zh-Hans
1261 \endcode
1262
1263 By default, the natural language is \c en for compatibility with
1264 legacy documentation.
1265
1266 QDoc will add the natural language information to the HTML it
1267 generates, using the \c lang and \c xml:lang attributes.
1268
1269 See also \l {sourceencoding-variable} {sourceencoding},
1270 \l {outputencoding-variable} {outputencoding},
1271 \l{http://www.w3.org/TR/xhtml1/#C_7}
1272 {C.7. The lang and xml:lang Attributes} and
1273 \l{http://www.w3.org/TR/i18n-html-tech-lang/#ri20040429.113217290}
1274 {Best Practice 13: Using Hans and Hant codes}.
1275
1276 \target navigation-variable
1277 \section1 navigation
1278
1279 The \c navigation sub-variables, if defined, set the home page, landing
1280 page, C++ classes page, and QML types page that are visible in the
1281 generated navigation bar for each page.
1282
1283 In a project with multiple sub-projects (for example, Qt modules), each
1284 sub-project typically defines its own landing page while the same home
1285 page is used across all sub-projects.
1286
1287 \b Sub-variables
1288
1289 \table
1290 \row \li \c navigation.homepage
1291 \li Project home page.
1292 \row \li \c navigation.hometitle
1293 \li (Optional) User-visible title for the home page.
1294 Default value is taken from \c homepage.
1295 \row \li \c navigation.landingpage
1296 \li Sub-project landing page.
1297 \row \li \c navigation.landingtitle
1298 \li (Optional) User-visible title for the landing page.
1299 Defaults value is taken from \c landingpage.
1300 \row \li \c navigation.cppclassespage
1301 \li Top-level page that lists all C++ classes for this (sub-)project.
1302 Typically, the title of a \l {module-command}{\\module} page.
1303 \row \li \c navigation.cppclassestitle
1304 \li (Optional) User-visible title for the C++ classes page.
1305 Default is "C++ Classes".
1306 \row \li \c navigation.qmltypespage
1307 \li Top-level page that lists all QML types for this (sub-)project.
1308 Typically, the title of a \l {qmlmodule-command}{\\qmlmodule} page.
1309 \row \li \c navigation.qmltypestitle
1310 \li (Optional) User-visible title for the QML types page.
1311 Default is "QML Types".
1312 \row \li \c navigation.toctitles (Since QDoc 6.0)
1313 \li Page title(s) containing a \l {list-command}{\\list} structure that
1314 acts as a table of contents (TOC). QDoc generates navigation links
1315 for pages listed in the TOC, without the need for
1316 \l {nextpage-command}{\\nextpage} and \l {previouspage-command}
1317 {\\previouspage} commands, as well as a navigation hierarchy that's
1318 visible in the navigation bar (breadcrumbs) for HTML output.
1319 \row \li \c navigation.toctitles.inclusive (Since QDoc 6.3)
1320 \li If set to \c true, page(s) listed in \c navigation.toctitles
1321 will also appear in the navigation bar as a root item.
1322 \row \li \c navigation.trademarkspage (Since QDoc 6.8)
1323 \li Title of a page that documents trademarks mentioned in the
1324 documentation. See also \qdoccmd tm command.
1325 \endtable
1326
1327 For example:
1328
1329 \badcode
1330 # Common configuration
1331 navigation.homepage = index.html
1332 navigation.hometitle = "Qt $QT_VER"
1333
1334 # qtquick.qdocconf
1335 navigation.landingpage = "Qt Quick"
1336 navigation.cppclassespage = "Qt Quick C++ Classes"
1337 navigation.qmltypespage = "Qt Quick QML Types"
1338 \endcode
1339
1340 The above configuration produces the following navigation bar for \c Item QML type:
1341
1342 \badcode
1343 Qt 5.10 > Qt Quick > QML Types > Item QML Type
1344 \endcode
1345
1346 \section2 Table of contents and navigation links
1347
1348 If there are one or more pages that act as a table of contents (TOC),
1349 list their titles in \c navigation.toctitles to automate
1350 the navigational (\e {previous} and \e {next} page) link generation
1351 for all pages listed in a TOC.
1352
1353 QDoc expects a \qdoccmd {list} of links on each TOC page. Nested
1354 sub-lists are allowed.
1355
1356 For example,
1357
1358 \badcode
1359 \list
1360 \li \l {Home}
1361 \li \l {Getting started}
1362 \li What's new
1363 \list
1364 \li \l {What's new in v1.3} {v1.3}
1365 \li \l {What's new in v1.2} {v1.2}
1366 \li \l {What's new in v1.1} {v1.1}
1367 \endlist
1368 \endlist
1369 \endcode
1370
1371 Since QDoc version 6.10, also \qdoccmd {generatelist} can appear
1372 in the table of contents list:
1373
1374 \badcode
1375 \list
1376 \li \l {Home}
1377 \li \l {Getting started}
1378 \li What's new
1379 \generatelist [descending] whatsnew
1380 \endlist
1381 \endcode
1382
1383 Here, the result is similar to the first \\list, assuming all
1384 three `What's new` pages are part of the same \c whatsnew group.
1385
1386 See also \qdoccmd {ingroup}.
1387
1388 \target overloadedsignalstarget-variable
1389 \section1 overloadedsignalstarget
1390
1391 \b {Default:} \c connecting-overloaded-signals
1392
1393 The \c overloadedsignalstarget variable specifies the link target used in
1394 automatically generated notes for overloaded signals.
1395
1396 When QDoc encounters an overloaded signal, it generates a note with a link
1397 to help documentation on connecting to overloaded signals. By default, this
1398 links to a target named \c connecting-overloaded-signals.
1399
1400 Projects can customize this to link to their own documentation:
1401
1402 \badcode
1403 # Link to a target within the project
1404 overloadedsignalstarget = signals-guide.html#overloaded-signals
1405
1406 # Link to external documentation
1407 overloadedsignalstarget = https://example.com/docs/signals.html#overloaded-signals
1408 \endcode
1409
1410 The target can be:
1411 \list
1412 \li A simple target name (for use with \qdoccmd {target} commands):
1413 \c {connecting-overloaded-signals}
1414 \li A relative URL: \c {signals-guide.html#overloaded-signals}
1415 \li An absolute URL: \c {https://example.com/docs/signals.html#overloaded-signals}
1416 \endlist
1417
1418 See also \l {overloadedslotstarget-variable} {overloadedslotstarget}.
1419
1420 \target overloadedslotstarget-variable
1421 \section1 overloadedslotstarget
1422
1423 \b {Default:} \c connecting-overloaded-slots
1424
1425 The \c overloadedslotstarget variable specifies the link target used in
1426 automatically generated notes for overloaded slots.
1427
1428 When QDoc encounters an overloaded slot, it generates a note with a link
1429 to help documentation on connecting to overloaded slots. By default, this
1430 links to a target named \c connecting-overloaded-slots.
1431
1432 Projects can customize this to link to their own documentation:
1433
1434 \badcode
1435 # Link to a target within the project
1436 overloadedslotstarget = signals-guide.html#overloaded-slots
1437
1438 # Link to external documentation
1439 overloadedslotstarget = https://example.com/docs/slots.html#overloaded-slots
1440 \endcode
1441
1442 The target can be:
1443 \list
1444 \li A simple target name (for use with \qdoccmd {target} commands):
1445 \c {connecting-overloaded-slots}
1446 \li A relative URL: \c {signals-guide.html#overloaded-slots}
1447 \li An absolute URL: \c {https://example.com/docs/slots.html#overloaded-slots}
1448 \endlist
1449
1450 See also \l {overloadedsignalstarget-variable} {overloadedsignalstarget}.
1451
1452 \target outputdir-variable
1453 \section1 outputdir
1454
1455 The \c outputdir variable specifies the directory where QDoc will
1456 put the generated documentation.
1457
1458 \badcode
1459 outputdir = $QTDIR/doc/html
1460 \endcode
1461
1462 locates the generated Qt reference documentation in
1463 $QTDIR/doc/html. For example, the documentation of the QWidget
1464 class is located in
1465
1466 \badcode
1467 $QTDIR/doc/html/qwidget.html
1468 \endcode
1469
1470 The associated images will be put in an \c images subdirectory.
1471
1472 \warning When running QDoc multiple times using the same output
1473 directory, all files from the previous run will be lost.
1474
1475 \target outputencoding-variable
1476 \section1 outputencoding
1477
1478 The \c outputencoding variable specifies the encoding used for the
1479 documentation generated by QDoc.
1480
1481 \badcode
1482 outputencoding = UTF-8
1483 \endcode
1484
1485 By default, the output encoding is \c ISO-8859-1 (Latin1) for
1486 compatibility with legacy documentation. When generating
1487 documentation for some languages, particularly non-European
1488 languages, this is not sufficient and an encoding such as UTF-8 is
1489 required.
1490
1491 QDoc will encode HTML using this encoding and generate the correct
1492 declarations to indicate to browsers which encoding is being
1493 used. The \l naturallanguage configuration variable should also be
1494 specified to provide browsers with a complete set of character
1495 encoding and language information.
1496
1497 See also \l outputencoding and \l naturallanguage.
1498
1499 \target outputformats-variable
1500 \section1 outputformats
1501
1502 The \c outputformats variable specifies the format(s) of
1503 the generated documentation.
1504
1505 Since Qt 5.11, QDoc supports the HTML and WebXML formats; since
1506 Qt 5.15, it can also generate the documentation in DocBook. If no
1507 \c outputformats are specified, QDoc generates the documentation
1508 in HTML (the default format). All output formats can be specified,
1509 with dedicated output directories and other settings. For example:
1510
1511 \badcode
1512 outputformats = WebXML HTML
1513 WebXML.nosubdirs = true
1514 WebXML.outputsubdir = webxml
1515 WebXML.quotinginformation = true
1516 \endcode
1517
1518 This generates HTML documentation using the default settings, as well
1519 as WebXML documentation into output subdirectory \e webxml.
1520
1521 \target outputprefixes-variable
1522 \section1 outputprefixes
1523
1524 The \c outputprefixes variable specifies a mapping between types of files
1525 and the prefixes to prepend to the output file names in the generated
1526 documentation.
1527
1528 QDoc supports adding an output prefix to the file names of QML type, C++
1529 class, namespace, and header file reference pages.
1530
1531 \badcode
1532 outputprefixes = QML CPP
1533 outputprefixes.QML = uicomponents-
1534 outputprefixes.CPP = components-
1535 \endcode
1536
1537 By default, files containing the API documentation for QML types
1538 are prefixed with \c {qml-}. In the above example, the prefix \c
1539 {uicomponents-} is used instead.
1540
1541 Likewise, C++ type documentation pages are prefixed with \c {components-}
1542 in the above example. By default, C++ type pages have no prefix.
1543
1544 \target outputsuffixes-variable
1545 \section1 outputsuffixes
1546
1547 The \c outputsuffixes variable specifies a mapping between types of
1548 files and suffixes to apply to the module or type name as they appear
1549 in the output file names.
1550
1551 QDoc supports adding an output suffix to the file names of module pages,
1552 QML type, C++ class, namespace, and header file reference pages.
1553
1554 By default, no suffix is used. The QML output suffix, if defined, is
1555 applied as a suffix to the module name as it appears in the file names
1556 of QML type and QML module pages.
1557
1558 File names for C++ types do not include the module name. The CPP
1559 output suffix, if defined, is applied as a suffix for the type name.
1560
1561 \badcode
1562 outputsuffixes = QML CPP
1563 {outputsuffixes.QML,outputsuffixes.CPP} = -tp
1564 \endcode
1565
1566 With the definitions above, given a QML module name \e FooBar and the default
1567 \l {outputprefixes-variable}{output prefix} (\c {qml-}), the name of
1568 the generated file for a QML type \e FooWidget is
1569 \c qml-foobar-tp-foowidget.html.
1570
1571 Likewise, for a C++ class \e QFoobar, QDoc generates \c qfoobar-tp.html.
1572
1573 The \c outputsuffixes variable was introduced in QDoc 5.6.
1574
1575 \target parsecppcomments-variable
1576 \section1 parsecppcomments
1577
1578 The \c parsecppcomments variable controls whether QDoc parses C++
1579 source files using the Clang-based C++ parser.
1580
1581 When set to \c false, QDoc skips Clang parsing and PCH generation for
1582 the project, and processes \c .cpp files using the pure documentation
1583 parser instead. This is useful for projects that document only QML APIs,
1584 where the C++ source files contain QDoc comments but no C++ entities to
1585 document.
1586
1587 The default value is \c true.
1588
1589 \code [text]
1590 parsecppcomments = false
1591 \endcode
1592
1593 \note Setting \qdocvar {moduleheader} to an empty string has the same
1594 effect, and is supported for backwards compatibility. \c parsecppcomments
1595 is the preferred way to express this intent.
1596
1597 The \c parsecppcomments variable was introduced to QDoc in Qt 6.12.
1598
1599 See also \qdocvar {moduleheader}.
1600
1601 \target qhp-variable
1602 \section1 qhp
1603
1604 The \c qhp sub-variables are used to define the information to be
1605 written out to Qt Help Project (\c{qhp}) files.
1606
1607 See the \l{Creating Help Project Files} chapter for information
1608 about this process.
1609
1610 Since QDoc 6.6, setting the base \c qhp variable to \c true means
1611 that a valid help project configuration is expected:
1612
1613 \badcode
1614 qhp = true
1615 \endcode
1616
1617 Then, if a project configuration did not define \c {qhp.projects},
1618 QDoc issues a warning. This is useful for ensuring that all
1619 documentation projects with a shared top-level \e .qdocconf file
1620 (as in Qt) are configured correctly.
1621
1622 To turn off the warning, set the variable to \c false.
1623
1624 \target showautogenerateddocs-variable
1625 \section1 showautogenerateddocs
1626
1627 The \c showautogenerateddocs boolean variable determines whether the
1628 documentation that QDoc generates automatically for explicitly
1629 defaulted and deleted special member functions appears in the output.
1630
1631 QDoc generates this documentation when no \qdoccmd fn block
1632 documents such a function. Documentation written with \qdoccmd fn
1633 always takes precedence over the generated text and is unaffected
1634 by this variable.
1635
1636 Setting this to \c false omits the auto-generated documentation:
1637
1638 \code [text]
1639 showautogenerateddocs = false
1640 \endcode
1641
1642 The default value is \c true.
1643
1644 The \c showautogenerateddocs variable was introduced in QDoc 6.12.
1645
1646 \target sourcedirs-variable
1647 \section1 sourcedirs
1648
1649 The \c sourcedirs variable specifies the directories containing
1650 the \c .cpp or \c .qdoc files used in the documentation.
1651
1652 \badcode
1653 sourcedirs += .. \
1654 ../../../examples/gui/doc/src
1655 \endcode
1656
1657 When executed, the first thing QDoc will do is to read through the
1658 headers specified in the \l {header-command} {\c header} variable,
1659 and the ones located in the directories specified in the \c
1660 headerdir variable (including all subdirectories), building an
1661 internal structure of the classes and their functions.
1662
1663 Then it will read through the sources specified in the \l
1664 {sources} {\c sources}, and the ones located in the directories
1665 specified in the \l {sourcedirs} {\c sourcedirs} variable
1666 (including all subdirectories), merging the documentation with the
1667 structure it retrieved from the header files.
1668
1669 If both the \c sources and \c sourcedirs variables are defined,
1670 QDoc will read through both, first \l {sources} {\c sources} then
1671 \c sourcedirs.
1672
1673 In the specified directories, QDoc will only read the files with
1674 the \c fileextensions specified in the \l {sources.fileextensions}
1675 {\c sources.fileextensions} variable. The files specified by \l {sources}
1676 {\c sources} will be read independent of their fileextensions.
1677
1678 QDoc finds new files in these directories on its own. To add a file
1679 to the documentation, place it in one of the directories listed in
1680 \c sourcedirs, or in any of their subdirectories, and give it one of
1681 the extensions in \c sources.fileextensions. You don't need to list
1682 it in \l {sources-variable} {sources}. Use \c sources only for files
1683 that are outside the source directories, or that have an extension
1684 QDoc wouldn't otherwise read. If QDoc doesn't pick up a file, check
1685 whether the \l {excludedirs-variable} {excludedirs} or
1686 \l {excludefiles-variable} {excludefiles} variables exclude it.
1687
1688 QDoc generates output only from the documentation comments in the
1689 files it reads. For example, a \c .qdoc file must contain a topic
1690 command, such as \l {page-command} {\\page}, to produce a page.
1691
1692 See also \l {sources-variable} {sources} and
1693 \l {sources.fileextensions-variable} {sources.fileextensions}.
1694
1695 \target sourceencoding-variable
1696 \section1 sourceencoding
1697
1698 The \c sourceencoding variable specifies the encoding used for the
1699 source code and documentation.
1700
1701 \badcode
1702 sourceencoding = UTF-8
1703 \endcode
1704
1705 By default, the source encoding is \c ISO-8859-1 (Latin1) for
1706 compatibility with legacy documentation. For some languages,
1707 particularly non-European languages, this is not sufficient and an
1708 encoding such as UTF-8 is required.
1709
1710 Although QDoc will use the encoding to read source and
1711 documentation files, limitations of C++ compilers may prevent you
1712 from using non-ASCII characters in source code comments. In cases
1713 like these, it is possible to write API documentation completely
1714 in documentation files.
1715
1716 See also \l {naturallanguage-variable} {naturallanguage} and
1717 \l {outputencoding-variable} {outputencoding}.
1718
1719 \target sources-variable
1720 \section1 sources
1721
1722 The \c sources variable allows you to specify individual source
1723 files in addition to those located in the directories specified by
1724 the \l {sourcedirs-variable} {sourcedirs} variable.
1725
1726 \badcode
1727 sources = $QTDIR/src/gui/widgets/qlineedit.cpp \
1728 $QTDIR/src/gui/widgets/qpushbutton.cpp
1729 \endcode
1730
1731 When processing the \c sources variable, QDoc behaves in the same
1732 way as it does when processing the \l {sourcedirs-variable}
1733 {sourcedirs} variable. For more information, see the \l
1734 {sourcedirs-variable} {sourcedirs} variable.
1735
1736 See also \l {sourcedirs-variable} {sourcedirs}.
1737
1738 \target sources.fileextensions-variable
1739 \section1 sources.fileextensions
1740
1741 The \c sources.fileextensions variable filters the files within a
1742 source directory.
1743
1744 When processing the source files specified in the \l {sourcedirs}
1745 {\c sourcedirs} variable, QDoc will only read the files with the
1746 fileextensions specified in the \c sources.fileextensions
1747 variable. In this way QDoc avoid spending time reading irrelevant
1748 files.
1749
1750 The default extensions are *.c++, *.cc, *.cpp, *.cxx, *.mm, *.qml
1751 and *.qdoc.
1752
1753 The extensions are given as standard wildcard expressions. You
1754 can add a file extension to the filter using '+='. For example:
1755
1756 \badcode
1757 sources.fileextensions += *.CC
1758 \endcode
1759
1760 \warning The above assignment may not work as described.
1761
1762 See also \l {sourcedirs-variable} {sourcedirs} and \l
1763 {sources-variable} {sources}.
1764
1765
1766 \target spurious-variable
1767 \section1 spurious
1768
1769 The \c spurious variable excludes specified QDoc warnings from the
1770 output. The warnings are specified using standard wildcard
1771 expressions.
1772
1773 \badcode
1774 spurious = "Cannot find .*" \
1775 "Missing .*"
1776 \endcode
1777
1778 makes sure that warnings matching either of these expressions,
1779 will not be part of the output when running QDoc. For example
1780 would the following warning be omitted from the output:
1781
1782 \badcode
1783 src/opengl/qgl_mac.cpp:156: Missing parameter name
1784 \endcode
1785
1786 \target syntaxhighlighting
1787 \section1 syntaxhighlighting
1788
1789 The \c syntaxhighlighting variable specifies whether QDoc should
1790 perform syntax highlighting on source code quoted in the
1791 documentation it generates.
1792
1793 \badcode
1794 syntaxhighlighting = true
1795 \endcode
1796
1797 will enable syntax highlighting for all supported programming
1798 languages.
1799
1800 \target tabsize-variable
1801 \section1 tabsize
1802
1803 The \c tabsize variable defines the size of a tab character.
1804
1805 \badcode
1806 tabsize = 4
1807 \endcode
1808
1809 will give the tab character the size of 4 spaces. The default
1810 value of the variable is 8, and doesn't need to be specified.
1811
1812 \target tagfile-variable
1813 \section1 tagfile
1814
1815 The \c tagfile variable specifies the Doxygen tag file to be
1816 written when HTML is generated.
1817
1818 \target version-variable
1819 \section1 version
1820
1821 The \c version variable specifies the version number of the
1822 documented software.
1823
1824 \badcode
1825 version = 5.6.0
1826 \endcode
1827
1828 When a version number is specified (using the \tt{\l version} or
1829 \tt {\l versionsym} variables in a \c .qdocconf file), it is
1830 accessible through the corresponding \\version command for use in
1831 the documentation.
1832
1833 \warning The \\version command's functionality is not fully
1834 implemented; currently it only works within raw HTML code.
1835
1836 See also \l versionsym.
1837
1838 \target versionsym-variable
1839 \section1 versionsym
1840
1841 The \c versionsym variable specifies a C++ preprocessor symbol
1842 that defines the version number of the documented software.
1843
1844 \badcode
1845 versionsym = QT_VERSION_STR
1846 \endcode
1847
1848 QT_VERSION_STR is defined in qglobal.h as follows
1849
1850 \badcode
1851 #define QT_VERSION_STR "5.14.1"
1852 \endcode
1853
1854 When a version number is specified (using the \tt{\l version} or
1855 \tt {\l versionsym} variables in a \c .qdocconf file), it is
1856 accessible through the corresponding \\version command for use in
1857 the documentation.
1858
1859 \warning The \\version command's functionality is not fully
1860 implemented. Currently, it only works within raw HTML code.
1861
1862 See also \l {version} {\\version}.
1863
1864 \target warninglimit-variable
1865 \section1 warninglimit
1866
1867 The \c warninglimit variable sets the maximum number of documentation
1868 warnings allowed. If this limit is exceeded, QDoc continues as normal
1869 but exits with the warning count as the error code. If the limit was
1870 not exceeded or \c warninglimit was not defined, QDoc process exits
1871 with 0, assuming there were no other critical errors.
1872
1873 Setting the \c warninglimit to \c 0 means failure on any warning.
1874
1875 \note By default, QDoc does not enforce the warning limit. Enable it
1876 with \c {warninglimit.enabled = true} or by defining
1877 the \c QDOC_ENABLE_WARNINGLIMIT environment variable.
1878
1879 For example,
1880
1881 \badcode
1882 # Fail the documentation build if we have more than 100 warnings
1883 warninglimit = 100
1884 warninglimit.enabled = true
1885 \endcode
1886
1887 The \c warninglimit variable was introduced in Qt 5.11.
1888*/
1889
1890/*!
1891 \page 22-creating-help-project-files.html
1892 \previouspage Generic Configuration Variables
1893 \nextpage Format-specific Configuration Variables
1894
1895 \title Creating Help Project Files
1896
1897 \section1 Overview
1898
1899 Qt Assistant uses a system for managing Qt documentation that requires
1900 QDoc to generate inventories of files.
1901
1902 QDoc allows configuration variables to be used to specify which pages are
1903 to be used in each documentation set it generates. These are specified as
1904 subvariables of the \c qhp variable with each set declared using a unique
1905 identifier as a subvariable.
1906
1907 For example, the configuration file for the Qt Quick documentation set
1908 specifies information about the set as subvariables with the
1909 \c{qhp.QtQuick} prefix:
1910
1911 \badcode
1912 qhp.projects = QtQuick
1913
1914 qhp.QtQuick.file = qtquick.qhp
1915 qhp.QtQuick.namespace = org.qt-project.qtquick.$QT_VERSION_TAG
1916 qhp.QtQuick.virtualFolder = qtquick
1917 qhp.QtQuick.indexTitle = Qt Quick
1918 qhp.QtQuick.indexRoot =
1919
1920 qhp.QtQuick.subprojects = qmltypes classes examples
1921
1922 qhp.QtQuick.subprojects.qmltypes.title = QML Types
1923 qhp.QtQuick.subprojects.qmltypes.indexTitle = Qt Quick QML Types
1924 qhp.QtQuick.subprojects.qmltypes.selectors = qmltype
1925 qhp.QtQuick.subprojects.qmltypes.sortPages = true
1926
1927 qhp.QtQuick.subprojects.classes.title = Classes
1928 qhp.QtQuick.subprojects.classes.title = C++ Classes
1929 qhp.QtQuick.subprojects.classes.indexTitle = Qt Quick C++ Classes
1930 qhp.QtQuick.subprojects.classes.selectors = class headerfile
1931 qhp.QtQuick.subprojects.classes.sortPages = true
1932
1933 qhp.QtQuick.subprojects.examples.title = Examples
1934 qhp.QtQuick.subprojects.examples.indexTitle = Qt Quick Examples and Tutorials
1935 qhp.QtQuick.subprojects.examples.selectors = example
1936 \endcode
1937
1938 The documentation set may include one or more subprojects, which are added
1939 to the table of contents under the name specified by \c title. The page
1940 in the documentation referred to by the \c indexTitle acts as the index page
1941 for the subproject. The page types to list under the subproject are specified
1942 by \c selectors. The entries are alphabetically sorted if \c sortPages is set
1943 to \c true.
1944
1945 \section2 Using Selectors
1946
1947 The \c selectors property specifies which page types are listed under the
1948 table of contents entry for a subproject. Multiple selectors can be listed,
1949 separated by whitespace.
1950
1951 \note If a subproject does not define a \c selectors property, all pages
1952 in the project are included by default.
1953
1954 \table
1955 \header \li Selector \li Description
1956 \row \li \c namespace \li Namespaces
1957 \row \li \c class \li Classes
1958 \row \li \c example \li Examples
1959 \row \li \c externalpage \li External page entries
1960 \row \li \c function \li Functions
1961 \row \li \c headerfile \li Header files
1962 \row \li \c page \li Overview pages
1963 \row \li \c property \li C++ properties
1964 \row \li \c typedef \li C++ typedef types
1965 \row \li \c typealias \li C++ type aliases
1966 \row \li \c variable \li C++ variables
1967 \row \li \c qmlproperty \li QML properties
1968 \row \li \c qmltype \li QML types
1969 \row \li \c qmlvaluetype \li QML value types
1970 \row \li \c module[:name] \li C++ modules or members of the module
1971 with a specified name.
1972 \row \li \c qmlmodule[:name] \li QML modules or members of the module
1973 with a specified name.
1974 \row \li \c group[:groupname] \li Documentation pages for members of a
1975 specified group, as added using the
1976 \l {ingroup-command}
1977 {\\ingroup} groupname command.
1978 Multiple group names can be listed as
1979 a comma-separated list.
1980 \row \li \c none \li Selects nothing; only a link to the
1981 \c indexTitle is generated.
1982 (Introduced in QDoc 6.9).
1983 \endtable
1984
1985 For example, the following configuration would select example pages and
1986 pages that include the \c {\ingroup tutorials} command:
1987
1988 \badcode
1989 qhp.QtQuickControls.subprojects = examples
1990 qhp.QtQuickControls.subprojects.examples.title = Examples and Tutorials
1991 qhp.QtQuickControls.subprojects.examples.indexTitle = Qt Quick Controls Examples
1992 qhp.QtQuickControls.subprojects.examples.selectors = example group:tutorials
1993 qhp.QtQuickControls.subprojects.examples.sortPages = true
1994 \endcode
1995
1996 \section2 Adding Table of Contents
1997
1998 To create a table of contents for a manual, create a subproject with
1999 a \c{type} property and set it to \c{manual}. The page in the documentation
2000 referred to by the \c{indexTitle} property must contain a list of links
2001 that acts as a table of contents for the whole manual. QDoc will take the
2002 information in this list and create a table of contents for the subproject.
2003
2004 For example, the configuration file for Qt Creator defines only one
2005 subproject for its documentation, including all the documentation in a
2006 single manual:
2007
2008 \badcode
2009 qhp.QtCreator.subprojects = manual
2010 qhp.QtCreator.subprojects.manual.title = Qt Creator Manual
2011 qhp.QtCreator.subprojects.manual.indexTitle = All topics
2012 qhp.QtCreator.subprojects.manual.type = manual
2013 \endcode
2014
2015 In this example, the page entitled "All topics" contains a nested
2016 list of links to pages in the documentation which is duplicated in
2017 Qt Assistant's Contents tab.
2018
2019 An example of such a list structure:
2020
2021 \badcode *
2022 /\1!
2023 \page qtcreator-toc.html
2024 \title All topics
2025
2026 \list
2027 \li \l {Installation}
2028 \li \l {Getting started}
2029 \list
2030 \li \l {Configuring Qt Creator}
2031 \li \l {Building and running an example}
2032 \endlist
2033 \li \l {Overview}
2034 \li \l {Tutorials}
2035 \generatelist tutorials
2036 ...
2037 \endlist
2038 \1/
2039 \endcode
2040
2041 Above, the \e {Getting started} topic has two pages as sub-topics.
2042 The \e {Tutorials} topic is a \qdoccmd {group} page, and a \qdoccmd
2043 {generatelist} command is used for listing individual tutorial pages
2044 (members of \c tutorials group) as its sub-topics.
2045*/
2046
2047/*!
2048 \page 24-qdoc-configuration-htmlvariables.html
2049 \previouspage Creating Help Project Files
2050 \nextpage Supporting Derived Projects
2051
2052 \keyword HTML Specific Configuration Variables
2053 \title Format-specific Configuration Variables
2054
2055 The format-specific configuration variables define the generated
2056 documentation's style, or define the contents of the
2057 documentation's footer or postheader.
2058
2059 Some of the configuration values are relevant only for the HTML
2060 output format and their values contain raw HTML.
2061
2062 \target HTML.footer-variable
2063 \section1 HTML.footer
2064
2065 The \c HTML.footer variable defines the content of the generated
2066 HTML documentation's footer.
2067
2068 The footer is rendered at the bottom of the generated
2069 documentation page.
2070
2071 The variable's value is given as raw HTML code enclosed by
2072 quotation marks. Note that if the value spans several lines, each
2073 line needs to be enclosed by quotation marks.
2074
2075 \badcode
2076 HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
2077 ...
2078 "</tr></table></div></address>"
2079 \endcode
2080
2081 \target FORMAT.nosubdirs
2082 \section1 <FORMAT>.nosubdirs
2083
2084 A boolean value which, when \c true, enables single-directory output
2085 mode; all generated files go to \l {FORMAT.outputsubdir} directory,
2086 instead of a subdirectory based on the documentation project name.
2087
2088 \target FORMAT.outputsubdir
2089 \section1 <FORMAT>.outputsubdir
2090
2091 Defines the subdirectory under \l outputdir where documentation is
2092 generated.
2093
2094 \badcode
2095 HTML.nosubdirs = true
2096 HTML.outputsubdir = html
2097 \endcode
2098
2099 With above, the output goes to \c {<outputdir>/html}.
2100
2101 \target HTML.postheader-variable
2102 \section1 HTML.postheader
2103
2104 The \c HTML.postheader variable defines the content of the
2105 generated HTML documentation's postheader.
2106
2107 The header is rendered at the top of the generated documentation
2108 page, immediately after the opening \c {<body>} element.
2109
2110 The variable's value is given as raw HTML enclosed by quotation
2111 marks. Note that if the value spans several lines, each line needs
2112 to be enclosed by quotation marks.
2113
2114 After rendering the content of \c HTML.postheader, QDoc outputs the
2115 page's breadcrumb navigation as set of \c {<li>} elements. Therefore,
2116 postheader must end with a valid parent element for \c {<li>}, such
2117 as \c {<ul>}. The default value for \c HTML.postheader is
2118
2119 \badcode
2120 HTML.postheader = "<ul class=\"breadcrumb\">\n"
2121 \endcode
2122
2123 See also \qdocvar {HTML.postpostheader}.
2124
2125 \target HTML.postpostheader-variable
2126 \section1 HTML.postpostheader
2127
2128 The \c HTML.postpostheader variable defines the content that
2129 closes the HTML document's postheader and its enclosed list of
2130 navigation breadcrumb items. Its value must include the
2131 matching closing tag for the list element opened in
2132 \qdocvar {HTML.postheader}.
2133
2134 The default value for \c HTML.postpostheader is
2135
2136 \badcode
2137 HTML.postpostheader = "</ul>\n"
2138 \endcode
2139
2140 \target FORMAT.quotinginformation
2141 \section1 <FORMAT>.quotinginformation
2142
2143 A boolean value which, when \c true, generates references to
2144 quoted content (for example, \l {quotefromfile-command}{\\quotefromfile}
2145 and \l {snippet-command}{\\snippet} commands) instead of including
2146 the content directly.
2147
2148 Used currently for the \c WebXML output format.
2149
2150 \badcode
2151 WebXML.quotinginformation = true
2152 \endcode
2153
2154 \target HTML.style-variable
2155 \section1 HTML.style
2156
2157 The HTML.style variable defines the style for
2158 the generated HTML documentation.
2159
2160 The variable's value is given as raw HTML enclosed by quotation
2161 marks. Note that if the value spans several lines, each line needs
2162 to be enclosed by quotation marks.
2163
2164 \badcode
2165 HTML.style = "h3.fn,span.fn" \
2166 "{ margin-left: 1cm; text-indent: -1cm; }\n" \
2167 "a:link { color: #004faf; text-decoration: none }\n" \
2168 "a:visited" \
2169 "{ color: #672967; text-decoration: none }\n" \
2170 "td.postheader { font-family: sans-serif }\n" \
2171 "tr.address { font-family: sans-serif }\n" \
2172 "body { background: #ffffff; color: black; }"
2173 \endcode
2174
2175 \target HTML.stylesheets-variable
2176 \section1 HTML.stylesheets
2177
2178 The HTML.stylesheets variable defines a list of stylesheets
2179 to use for the generated HTML documentation.
2180
2181 Using separate stylesheets for the documentation makes it easier
2182 to customize and experiment with the style used once the contents
2183 has been generated. Typically, it is only necessary to define a
2184 single stylesheet for any set of documentation; for example:
2185
2186 \badcode
2187 HTML.stylesheets = path/to/classic.css
2188 \endcode
2189
2190 QDoc expects to find stylesheets in the directory containing the
2191 \l qtgui.qdocconf file, and it will copy those specified to the output
2192 directory alongside the HTML pages.
2193
2194 \target HTML.tocdepth
2195 \section1 <FORMAT>.tocdepth
2196
2197 The \c {<FORMAT>.tocdepth} variable defines how many document sections
2198 are printed in the table of contents. Setting tocdepth to \c 0 disables
2199 the table of contents while leaving it undefined prints all document
2200 sections.
2201
2202 Currently only has an effect for the HTML format:
2203
2204 \badcode
2205 HTML.tocdepth = 3
2206 \endcode
2207*/
2208
2209/*!
2210 \page 25-qdoc-configuration-derivedprojects.html
2211 \previouspage Format-specific Configuration Variables
2212 \nextpage Example Manifest Files
2213
2214 \title Supporting Derived Projects
2215
2216 Some configuration variables allow you to use QDoc to support
2217 Qt-based projects. They allow your project to contain links to the
2218 online Qt documentation, which means that QDoc will be able to
2219 create links to the class reference documentation, without any
2220 explicit linking command.
2221
2222 \target description-variable
2223 \section1 description
2224
2225 The description variable holds a short description of the
2226 associated project.
2227
2228 See also \l project.
2229
2230 \target indexes-variable
2231 \section1 indexes
2232
2233 The \c indexes variable defines a set of paths to index files to load.
2234
2235 \badcode
2236 indexes = \
2237 $QT_INSTALL_DOCS/qtcore/qtcore.index \
2238 $SOME_OTHER_PROJECT/doc/foo.index
2239 \endcode
2240
2241 The \c indexes variable provides an alternative to \l depends for
2242 defining project's dependencies. As direct paths are provided, no
2243 \c --indexdir command line option(s) are required when invoking QDoc.
2244
2245 It is possible to define dependencies using either variable. Qt
2246 documentation only uses the \c depends variable.
2247
2248 See also \l depends, \l project and \l url.
2249
2250 \target preliminary-variable
2251 \section1 preliminary
2252
2253 Use the \c preliminary variable to customize the status descriptor
2254 assigned to elements using the \qdoccmd preliminary command.
2255
2256 By default, QDoc marks these elements with \c Preliminary
2257 descriptor in the API reference, and generates a message
2258
2259 \quotation
2260 \b {This <element type> is under development and is subject to change.}
2261 \endquotation
2262
2263 In the element's documentation body. QDoc replaces \e {<element type>}
2264 in above message with the type (for example, "module", "function", or
2265 "class").
2266
2267 To use a custom status descriptor, define a \c preliminary variable:
2268
2269 \code [text]
2270 preliminary = "Technology preview"
2271 \endcode
2272
2273 To use a custom status message, define also a \c preliminary.description
2274 subvariable:
2275
2276 \code [text]
2277 preliminary = "Technology preview"
2278 preliminary.description = "This \1 is in technology preview and is subject to change."
2279 \endcode
2280
2281 If a placeholder \c {\1} appears in the description, QDoc replaces it
2282 with the element type.
2283
2284 The \c preliminary variable was introduced to QDoc in Qt 6.12.
2285
2286 \target productname-variable
2287 \section1 productname
2288
2289 Use the \c productname variable if the name of the product being documented
2290 is different from the name of the documentation \qdocvar project. This is
2291 particularly useful for larger documentation sets that consist of multiple
2292 documentation projects and/or modules, as it allows QDoc to generate the
2293 product name instead of project name in certain contexts, such as the
2294 \qdoccmd since command.
2295
2296 For example, Qt defines \e Qt as the \c productname, while each individual
2297 module defines its own \c project name. This allows authors to use the
2298 shorthand notation for the \qdoccmd since command.
2299
2300 This configuration variable was introduced to QDoc with Qt 6.9.
2301
2302 See also \qdoccmd {since}.
2303
2304 \target project-variable
2305 \section1 project
2306
2307 The \c project variable provides a name for the project associated
2308 with the \c .qdocconf file. This is a mandatory variable that all
2309 projects must set.
2310
2311 The project's name is used to form a file name for the associated
2312 project's \e index file.
2313
2314 \badcode
2315 project = QtCreator
2316 \endcode
2317
2318 This will cause an index file called \c qtcreator.index to be
2319 created.
2320
2321 If the project name contains whitespace or special characters,
2322 these are replaced with dashes ('-') in the generated index file
2323 name.
2324
2325 See also \l depends, \l indexes, and \l description.
2326
2327 \target projectroot-variable
2328 \section1 projectroot
2329
2330 The \c projectroot variable sets the project root directory for relative
2331 path calculation in warning logs.
2332
2333 \badcode
2334 projectroot = /path/to/project/root
2335 \endcode
2336
2337 QDoc uses the following priority order to determine the project root:
2338
2339 \list 1
2340 \li \c QDOC_PROJECT_ROOT environment variable
2341 \li \c projectroot configuration variable
2342 \li If neither is set, absolute paths are used
2343 \endlist
2344
2345 When a project root is set, QDoc converts absolute file paths to relative
2346 paths in warning log files. This makes logs portable across different
2347 build environments.
2348
2349 Qt's build system automatically sets \c QDOC_PROJECT_ROOT, so you
2350 typically don't need to set \c projectroot manually.
2351
2352 For standalone QDoc usage, setting \c projectroot enables portable
2353 warning logs:
2354
2355 \badcode
2356 projectroot = /home/user/myproject
2357 logwarnings = true
2358 \endcode
2359
2360 The \c projectroot variable was introduced in QDoc 6.11.
2361 See also \l logwarnings.
2362
2363 \target url-variable
2364 \section1 url
2365
2366 The \c url variable holds the base URL for the
2367 documentation associated with the current project.
2368
2369 The URL is stored in the generated index file for the
2370 project. When we use the index on its own, QDoc will use this as
2371 the base URL when constructing links to classes, functions, and
2372 other things listed in the index.
2373
2374 \badcode
2375 project = QtCore
2376 description = Qt Core Reference Documentation
2377 url = https://doc.qt.io/qt/
2378
2379 ...
2380 \endcode
2381
2382 This ensures that whenever QDoc generates
2383 references to entities in the Qt Core module, the base URL is
2384 \c https://doc.qt.io/qt/.
2385
2386 See also \l depends, \l indexes and \l {url.examples}.
2387
2388 \target url.examples-variable
2389 \section1 url.examples
2390
2391 The \c url.examples variable holds the base URL for the examples
2392 associated with the current project.
2393
2394 If defined, a link to the example project directory is generated
2395 at the end of each example documentation page. The \c url.examples
2396 variable refers to the root directory of the examples related to
2397 this project; it can be a link to an online repository (starting
2398 with \e http:// or \e https://), or to the local file system
2399 (\c file://).
2400
2401 If \c url.examples is not defined, QDoc will output a list of
2402 example's files and images instead.
2403
2404 For example, given these definitions:
2405
2406 \badcode
2407 url.examples = "https://code.qt.io/cgit/qt/qtbase.git/tree/examples/"
2408 examplesinstallpath = corelib
2409 \endcode
2410
2411 Then, for the following \l {example-command}{\\example} command:
2412
2413 \badcode *
2414 /\1!
2415 \example threads/semaphores
2416 ...
2417 \1/
2418 \endcode
2419
2420 QDoc generates a link to
2421 \c https://code.qt.io/cgit/qt/qtbase.git/tree/examples/corelib/threads/semaphores.
2422
2423 If the URL contains more components (for example, a query string)
2424 after the example path, \\1 can be used as a placeholder for the
2425 path:
2426
2427 \badcode
2428 url.examples = "https://code.qt.io/cgit/qt/qtbase.git/tree/examples/\1?h=$QT_VER"
2429 examplesinstallpath = corelib
2430 \endcode
2431
2432 Given the same \\example command as above and assuming that
2433 \c $QT_VER expands to \c {5.13}, the generated URL is
2434 \c https://code.qt.io/cgit/qt/qtbase.git/tree/examples/corelib/threads/semaphores?h=5.13.
2435
2436 \c {url.examples} variable was introduced in QDoc version 5.13.
2437
2438 See also \l url, \l examplesinstallpath, and \l {example-command}{\\example}.
2439
2440 \target url.sources-variable
2441 \section1 url.sources
2442
2443 The \c {url.sources} variable holds the base URL for the C++ source
2444 code associated with the current project. This is a URL for viewing
2445 the project's sources in a repository, for example, on \e {github.com}.
2446
2447 Enable the source links by setting \c {url.sources.enabled} to
2448 \c true. When enabled, QDoc generates a link to a declaration
2449 in the \e synopsis (signature) of each documented C++ entity in its
2450 \e {Detailed description} section.
2451
2452 In addition, define the root directory of the sources with
2453 \c {url.sources.rootdir}. The generated link is composed of the
2454 base URL (\c {url.sources}) and the path of the source file, relative
2455 to \c {url.sources.rootdir}.
2456
2457 If the URL contains more components after the path (for example, a query
2458 string specifying a branch), \\1 acts as a placeholder for
2459 the path. Similarly, \\2 acts as a placeholder for the line number.
2460
2461 \c {url.sources.linktext} sets the user-visible link text for source
2462 links. By default, the link text is an empty string; use the \c {a.srclink}
2463 CSS selector to style the links in the HTML output.
2464
2465 For example, with the following configuration in
2466 \c {qtbase/src/gui/doc/qtgui.qdocconf}:
2467
2468 \badcode
2469 url.sources = "https://code.qt.io/cgit/qt/qtbase.git/tree/\1?h=$QT_VER#n\2"
2470 url.sources.rootdir = ../../.. # root of the `qtbase` repository
2471 url.sources.linktext = "(source)"
2472 url.sources.enabled = true
2473 \endcode
2474
2475 QDoc will generate links to \e code.qt.io for each documented C++
2476 entity, specific to the branch defined with the \c QT_VER environment
2477 variable.
2478
2479 The \c {url.sources} variable was introduced to QDoc with Qt 6.10.
2480
2481 \target usealttextastitle-variable
2482 \section1 usealttextastitle
2483 In some cases, it's desirable to provide a "tooltip" for images when
2484 rendered in graphical browsers. QDoc offers a way to do this, where the
2485 \e alt text given as an optional string to the \qdoccmd image command is
2486 also used as the \e title attribute for the image. Enable this behavior
2487 by setting the this variable with \c {usealttextastitle = true} in your
2488 QDoc configuration file.
2489
2490 This configuration variable was introduced to QDoc with Qt 6.9.
2491
2492
2493 \target howto
2494 \section1 How to Support Derived Projects
2495
2496 This feature makes use of the comprehensive indexes generated by
2497 QDoc when it creates the Qt reference documentation.
2498
2499 For example, \l qtgui.qdocconf (the configuration file for Qt GUI)
2500 contains the following variable definitions:
2501
2502 \badcode
2503 project = QtGui
2504 description = Qt GUI Reference Documentation
2505 url = https://doc.qt.io/qt/
2506
2507 ...
2508 \endcode
2509
2510 The \l project variable name is used to form a file name for the
2511 index file; in this case the \c qtgui.index file is created. The \l
2512 url is stored in the index file. Afterwards, QDoc will use this
2513 as the base URL when constructing links to classes, functions,
2514 and other things listed in the index.
2515
2516 See also \l depends, \l indexes, \l project, and \l url.
2517*/
2518
2519/*!
2520 \page 26-qdoc-configuration-example-manifest-files.html
2521 \previouspage Supporting Derived Projects
2522
2523 \title Example Manifest Files
2524
2525 QDoc generates example-manifest.xml files that contain information about
2526 all documented examples. These files are used by Qt Creator to present a
2527 list of examples in its welcome screen and to link to their documentation.
2528
2529 \section1 Manifest XML Structure
2530
2531 A manifest file has the following structure:
2532
2533 \badcode
2534 <?xml version="1.0" encoding="UTF-8"?>
2535 <instructionals module="QtGui">
2536 <examples>
2537 <example
2538 name="Analog Clock Window"
2539 docUrl="qthelp://org.qt-project.qtgui.502/qtgui/analogclock.html"
2540 projectPath="gui/analogclock/analogclock.pro"
2541 imageUrl="qthelp://org.qt-project.qtgui.502/qtgui/images/analogclock-window.png">
2542 <description><![CDATA[The Analog Clock Window example shows how
2543 to draw the contents of a custom window.]]></description>
2544 <tags>analog,clock,window</tags>
2545 <fileToOpen>gui/analogclock/main.cpp</fileToOpen>
2546 </example>
2547 ...
2548 </examples>
2549 </instructionals>
2550 \endcode
2551
2552 Each \c {<example>} element contains information about a name,
2553 description, the location of the project file and documentation,
2554 as well as a list of tags associated with the example.
2555
2556 \target metacontent
2557 \section1 Manifest Meta Content
2558
2559 It is possible to augment the manifest files with additional
2560 meta-content - that is, extra attributes and tags for selected
2561 examples, using the \c manifestmeta configuration command.
2562
2563 One use case for meta-content is highlighting a number of prominent
2564 examples. Another is improving search functionality by adding
2565 relevant keywords as tags for a certain category of examples.
2566
2567 The examples for which meta-content is applied to is specified using
2568 one or more filters. Matching examples to filters is done based on
2569 names, with each example name prefixed with a module name and a
2570 slash. Simple wildcard matching is supported; by using \c {*} at the
2571 end it's possible to match multiple examples with a single string.
2572
2573 Example:
2574
2575 \badcode
2576 manifestmeta.filters = highlighted sql webkit global
2577
2578 manifestmeta.highlighted.names = "QtGui/Analog Clock Window" \
2579 "QtWidgets/Analog Clock"
2580 manifestmeta.highlighted.attributes = isHighlighted:true
2581
2582 manifestmeta.sql.names = "QtSql/*"
2583 manifestmeta.sql.tags = database,sql
2584
2585 manifestmeta.webkit.names = "QtWebKitExamples/*"
2586 manifestmeta.webkit.tags = webkit
2587
2588 manifestmeta.global.names = *
2589 manifestmeta.global.tags = qt6
2590 \endcode
2591
2592 Above, an \c isHighlighted attribute is added to two examples. If
2593 the attribute value is omitted, QDoc uses the string \c {true} by
2594 default. Extra tags are added for Qt WebKit and Qt SQL examples, and
2595 another tag is applied to all examples by using just \c {*} as the
2596 match string.
2597*/
2598
2599/*!
2600 \page 21-1-minimum-qdocconf.html
2601 \previouspage qtgui.qdocconf
2602 \nextpage The QDoc Configuration File
2603
2604 \title minimum.qdocconf
2605
2606 \quotefile examples/minimum.qdocconf
2607*/
2608
2609/*!
2610 \page 21-2-qtgui-qdocconf.html
2611 \previouspage Supporting Derived Projects
2612 \nextpage minimum.qdocconf
2613
2614 \title qtgui.qdocconf
2615
2616 \quotefile files/qtgui.qdocconf
2617*/
2618
2619/*!
2620 \externalpage https://highlightjs.readthedocs.io/en/latest/supported-languages.html
2621 \title languages supported by highlight.js
2622*/