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