Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

Qt5ModuleQDocconf

From Qt Wiki
Jump to navigation Jump to search
This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine.
Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean.

Qt 5 Module qdocconf Files

Each module in Qt 5 need a qdocconf file to build its documentation set.

Sample

Here is a sample qdocconf file from Qt Contacts: It is located in qt5/qtpim/src/contacts/doc/qtcontacts.qdocconf

#include this line to inherit the default templates, macros, and settings. QT_INSTALL_DOCS must be set. Run "qmake -query" to find the path set to QT_INSTALL_DOCS.
include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)

project = QtSql #the project file determines the .index file. qtsql.index is the filename for Qt SQL's index file
description = Qt SQL Reference Documentation
url = http://doc.qt.io/qt-$QT_VER/qtsql
version = $QT_VERSION


#The qhp variables determine how the documentation is configured for Qt Creator and Qt Assistant
qhp.projects = QtSql

qhp.QtSql.file = qtsql.qhp
qhp.QtSql.namespace = org.qt-project.qtsql.$QT_VERSION_TAG
qhp.QtSql.virtualFolder = qtsql
qhp.QtSql.indexTitle = Qt SQL
qhp.QtSql.indexRoot =

qhp.QtSql.filterAttributes = qtsql $QT_VERSION qtrefdoc
qhp.QtSql.customFilters.Qt.name = QtSql $QT_VERSION
qhp.QtSql.customFilters.Qt.filterAttributes = qtsql $QT_VERSION

qhp.QtSql.subprojects = classes
qhp.QtSql.subprojects.classes.title = C++ Classes
qhp.QtSql.subprojects.classes.indexTitle = Qt SQL C++ Classes
qhp.QtSql.subprojects.classes.selectors = class fake:headerfile
qhp.QtSql.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtsql/qtsql.tags

#these depends match the index files in QT_INSTALL_DOCS. qtcore.index is in the directory called qtcore
depends ''= qtcore qtwidgets qtdoc

headerdirs''= ..

sourcedirs ''= ..  ../../../examples/sql/doc/src

exampledirs''= ../../../examples/sql  ../  snippets

imagedirs ''= images  ../../../examples/sql/doc/images

Another Example with QML types

Here is another example for a module with QML types. This file is found in qt5/qtmultimedia/src/multimedia/doc

include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)

project = QtMultimedia
description = Qt Multimedia Documentation
url = http://doc.qt.io/qt-$QT_VER/qtmultimedia
version = $QT_VERSION

# The following parameters are for creating a qhp file, the qhelpgenerator
# program can convert the qhp file into a qch file which can be opened in
# Qt Assistant and/or Qt Creator.

# Defines the name of the project. You cannot use operators ('', =,-) in
# the name. Properties for this project are set using a qhp.<projectname>.property
# format.
qhp.projects = QtMultimedia
qhp.QtMultimedia.file = qtmultimedia.qhp
qhp.QtMultimedia.namespace = org.qt-project.qtmultimedia.$QT_VERSION_TAG
qhp.QtMultimedia.indexTitle = Qt Multimedia
qhp.QtMultimedia.virtualFolder = qtmultimedia

# For listing child nodes in Qt Creator or Assistant.
qhp.QtMultimedia.subprojects = classes qmltypes
qhp.QtMultimedia.subprojects.classes.title = C++ Classes
qhp.QtMultimedia.subprojects.classes.indexTitle = Qt Multimedia C++ Classes
qhp.QtMultimedia.subprojects.classes.selectors = class fake:headerfile
qhp.QtMultimedia.subprojects.classes.sortPages = true
qhp.QtMultimedia.subprojects.qmltypes.title = QML Types
qhp.QtMultimedia.subprojects.qmltypes.indexTitle = Qt Multimedia QML Types
qhp.QtMultimedia.subprojects.qmltypes.selectors = fake:qmlclass
qhp.QtMultimedia.subprojects.qmltypes.sortPages = true

exampledirs ''= ..  ../../../examples

headerdirs''= ../..

imagedirs ''= src/images 
sourcedirs''= ../..

excludedirs ''=

depends''= qtcore qtdoc qtquick qtqml

Notes

  • Please use CamelCase for module names defined in qhp.projects, as above. This ensures that the module names are correctly added as tags into example manifest file, and the examples can be found in Qt Creator's Welcome mode by searching for the module

List of valid selector types:

  • namespace
  • class
  • enum
  • typedef
  • function
  • property
  • variable
  • qmlproperty
  • qmlsignal
  • qmlsignalhandler
  • qmlmethod
  • fake

A 'fake' type specifies a generic documentation node, and is followed by :subtype specifier. Valid subtypes:

  • example
  • headerfile
  • file
  • group
  • module
  • page
  • externalpage
  • qmlclass
  • qmlpropertygroup
  • qmlbasictype