Supporting Derived Projects
Some configuration variables allow you to use QDoc to support Qt-based projects. They allow your project to contain links to the online Qt documentation, which means that QDoc will be able to create links to the class reference documentation, without any explicit linking command.
The description variable holds a short description of the associated project.
See also project.
indexes variable defines a set of paths to index files to load.
indexes = \ $QT_INSTALL_DOCS/qtcore/qtcore.index \ $SOME_OTHER_PROJECT/doc/foo.index
indexes variable provides an alternative to depends for defining project's dependencies. As direct paths are provided, no
-indexdir command line option(s) are required when invoking QDoc.
It is possible to define dependencies using either variable. Qt documentation only uses the
project variable provides a name for the project associated with the
.qdocconf file. This is a mandatory variable that all projects must set.
The project's name is used to form a file name for the associated project's index file.
project = QtCreator
This will cause an index file called
qtcreator.index to be created.
If the project name contains whitespace or special characters, these are replaced with dashes ('-') in the generated index file name.
url variable holds the base URL for the documentation associated with the current project.
The URL is stored in the generated index file for the project. When we use the index on its own, QDoc will use this as the base URL when constructing links to classes, functions, and other things listed in the index.
project = QtCore description = Qt Core Reference Documentation url = https://doc.qt.io/qt/ ...
This ensures that whenever QDoc generates references to entities in the Qt Core module, the base URL is
url.examples variable holds the base URL for the examples associated with the current project.
If defined, a link to the example project directory is generated at the end of each example documentation page. The
url.examples variable refers to the root directory of the examples related to this project; it can be a link to an online repository (starting with http:// or https://), or to the local file system (
url.examples is not defined, QDoc will output a list of example's files and images instead.
For example, given these definitions:
url.examples = "https://code.qt.io/cgit/qt/qtbase.git/tree/examples/" examplesinstallpath = corelib
Then, for the following \example command:
/*! \example threads/semaphores ... */
QDoc generates a link to
If the URL contains more components (for example, a query string) after the example path, \1 can be used as a placeholder for the path:
url.examples = "https://code.qt.io/cgit/qt/qtbase.git/tree/examples/\1?h=$QT_VER" examplesinstallpath = corelib
Given the same \example command as above and assuming that
$QT_VER expands to
5.13, the generated URL is
url.examples variable was introduced in QDoc version 5.13.
This feature makes use of the comprehensive indexes generated by QDoc when it creates the Qt reference documentation.
For example, qtgui.qdocconf (the configuration file for Qt GUI) contains the following variable definitions:
project = QtGui description = Qt GUI Reference Documentation url = http://doc.qt.io/qt/ ...
The project variable name is used to form a file name for the index file; in this case the
qtgui.index file is created. The url is stored in the index file. Afterwards, QDoc will use this as the base URL when constructing links to classes, functions, and other things listed in the index.
© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.