Creating Help Project Files
Qt Assistant uses a system for managing Qt documentation that requires QDoc to generate inventories of files.
QDoc allows configuration variables to be used to specify which pages are to be used in each documentation set it generates. These are specified as subvariables of the
qhp variable with each set declared using a unique identifier as a subvariable.
For example, the configuration file for the Qt Quick documentation set specifies information about the set as subvariables with the
qhp.projects = QtQuick qhp.QtQuick.file = qtquick.qhp qhp.QtQuick.namespace = org.qt-project.qtquick.$QT_VERSION_TAG qhp.QtQuick.virtualFolder = qtquick qhp.QtQuick.indexTitle = Qt Quick qhp.QtQuick.indexRoot = qhp.QtQuick.subprojects = qmltypes classes examples qhp.QtQuick.subprojects.qmltypes.title = QML Types qhp.QtQuick.subprojects.qmltypes.indexTitle = Qt Quick QML Types qhp.QtQuick.subprojects.qmltypes.selectors = qmlclass qhp.QtQuick.subprojects.qmltypes.sortPages = true qhp.QtQuick.subprojects.classes.title = Classes qhp.QtQuick.subprojects.classes.title = C++ Classes qhp.QtQuick.subprojects.classes.indexTitle = Qt Quick C++ Classes qhp.QtQuick.subprojects.classes.selectors = class fake:headerfile qhp.QtQuick.subprojects.classes.sortPages = true qhp.QtQuick.subprojects.examples.title = Examples qhp.QtQuick.subprojects.examples.indexTitle = Qt Quick Examples and Tutorials qhp.QtQuick.subprojects.examples.selectors = fake:example
The documentation set may include one or more subprojects, which are added to the table of contents under the name specified by
title. The page in the documentation referred to by the
indexTitle acts as the index page for the subproject. The page types to list under the subproject are specified by
selectors. The entries are alphabetically sorted if
sortPages is set to
selectors property specifies which page types are listed under the table of contents entry for a subproject. Multiple selectors can be listed, separated by whitespace.
|Alias for |
|C++ modules or members of the module with a specified name.|
|QML modules or members of the module with a specified name.|
|Documentation pages with a specified |
|Alias for |
|Documentation pages for members of a specified group, as added using the \ingroup groupname command. Multiple group names can be listed as a comma-separated list. (Introduced in QDoc 5.6).|
Available subtypes for the
|Documentation pages defined with the \page command.|
For example, the following configuration would select example pages and pages that include the
\ingroup tutorials command:
qhp.QtQuickControls.subprojects = examples qhp.QtQuickControls.subprojects.examples.title = Examples and Tutorials qhp.QtQuickControls.subprojects.examples.indexTitle = Qt Quick Controls Examples qhp.QtQuickControls.subprojects.examples.selectors = doc:example group:tutorials qhp.QtQuickControls.subprojects.examples.sortPages = true
Adding Table of Contents
To create a table of contents for a manual, create a subproject with a
type property and set it to
manual. The page in the documentation referred to by the
indexTitle property must contain a list of links that acts as a table of contents for the whole manual. QDoc will take the information in this list and create a table of contents for the subproject.
For example, the configuration file for Qt Creator defines only one subproject for its documentation, including all the documentation in a single manual:
qhp.QtCreator.subprojects = manual qhp.QtCreator.subprojects.manual.title = Qt Creator Manual qhp.QtCreator.subprojects.manual.indexTitle = Qt Creator Manual qhp.QtCreator.subprojects.manual.type = manual
In this example, the page entitled "Qt Creator Manual" contains a nested list of links to pages in the documentation which is duplicated in Qt Assistant's Contents tab.
© 2023 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.