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