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