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