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