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