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.

description

The description variable holds a short description of the associated project.

See also project.

indexes

The indexes variable lists the index files that will be used to generate references.

For example. to make a derived Qt project contain links to the Qt Reference documentation, you need to specify the associated index file:

indexes = $QTDIR/doc/html/qt.index

See also project and url.

project

The project variable provides a name for the project associated with the .qdocconf file.

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.

See also description and indexes.

url

The url variable holds the base URL for the reference 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     = Qt
description = Qt Reference Documentation
url         = http://doc.qt.io/qt-4.8/

     ...

This makes sure that whenever qt.index is used to generate references to for example Qt classes, the base URL is http://doc.qt.io/qt-4.8/.

See also indexes and url.examples.

url.examples

The 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 (file://).

If 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 https://code.qt.io/cgit/qt/qtbase.git/tree/examples/corelib/threads/semaphores.

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 https://code.qt.io/cgit/qt/qtbase.git/tree/examples/corelib/threads/semaphores?h=5.13.

url.examples variable was introduced in QDoc version 5.13.

See also url, examplesinstallpath, and \example.

How to Support Derived Projects

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) contains the following variable definitions:

project     = Qt
description = Qt Reference Documentation
url         = http://doc.qt.io/qt-4.8/

...

The project variable name is used to form a file name for the index file; in this case the qt.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.

© 2019 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.