Skip to content

Commit 45f0cff

Browse files
committedMay 19, 2016
Allow generation of Qt QHP help files from doxygen
This adds a new cmake option GENERATE_QHP. If the api docs are set to being built (ie doxygen is available and WITH_APIDOC is true) then setting GENERATE_QHP to true will cause doxygen to create a compiled Qt help file from the QGIS docs. This QHP file can then be used by QtCreator to show the QGIS api directly within the QtCreator help (ie, press F1 on a class or member to see the docs). To do this, you need to: - make sure doxygen is installed, WITH_APIDOC is true and GENERATE_QHP is true - build to generate the docs - In QtCreator, go to Tools -> Options -> Help, switch to the "Documentation" tab and click "Add". Point it to your generate QHP file (should be in the build folder doc\api\qch folder) - Restart QtCreator, wait a bit, and then you should have the api docs available under the "Help" tab and by pressing F1 on a QGIS class/method
1 parent 23a3a77 commit 45f0cff

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed
 

‎cmake_templates/Doxyfile.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ TOC_EXPAND = NO
970970
# that can be used as input for Qt's qhelpgenerator to generate a
971971
# Qt Compressed Help (.qch) of the generated HTML documentation.
972972

973-
GENERATE_QHP = NO
973+
GENERATE_QHP = @WITH_QHP@
974974

975975
# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
976976
# be used to specify the file name of the resulting .qch file.
@@ -982,13 +982,13 @@ QCH_FILE =
982982
# Qt Help Project output. For more information please see
983983
# http://doc.trolltech.com/qthelpproject.html#namespace
984984

985-
QHP_NAMESPACE = org.doxygen.Project
985+
QHP_NAMESPACE = org.qgis.qgis2
986986

987987
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
988988
# Qt Help Project output. For more information please see
989989
# http://doc.trolltech.com/qthelpproject.html#virtual-folders
990990

991-
QHP_VIRTUAL_FOLDER = doc
991+
QHP_VIRTUAL_FOLDER = qgis
992992

993993
# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
994994
# add. For more information please see
@@ -1016,7 +1016,7 @@ QHP_SECT_FILTER_ATTRS =
10161016
# If non-empty doxygen will try to run qhelpgenerator on the generated
10171017
# .qhp file.
10181018

1019-
QHG_LOCATION =
1019+
QHG_LOCATION = qhelpgenerator
10201020

10211021
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
10221022
# will be generated, which together with the HTML files, form an Eclipse help

‎doc/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ IF(WITH_APIDOC)
3131
FIND_PACKAGE(Doxygen 1.8.2 REQUIRED)
3232
IF(DOXYGEN_FOUND)
3333

34+
# Whether to generate QHP file
35+
SET (GENERATE_QHP FALSE CACHE BOOL "Determines whether to generate Qt QHP help from the QGIS API Docs")
36+
IF (GENERATE_QHP)
37+
SET(WITH_QHP YES)
38+
ELSE(GENERATE_QHP)
39+
SET(WITH_QHP NO)
40+
ENDIF(GENERATE_QHP)
41+
3442
FIND_FILE(QT_TAG_FILE
3543
NAMES qt4.tags qt4.tag qt.tags qt.tag
3644
PATHS "${QT_DOC_DIR}"

0 commit comments

Comments
 (0)
Please sign in to comment.