Skip to content

Commit

Permalink
Allow generation of Qt QHP help files from doxygen
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nyalldawson committed May 19, 2016
1 parent 23a3a77 commit 45f0cff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmake_templates/Doxyfile.in
Expand Up @@ -970,7 +970,7 @@ TOC_EXPAND = NO
# that can be used as input for Qt's qhelpgenerator to generate a
# Qt Compressed Help (.qch) of the generated HTML documentation.

GENERATE_QHP = NO
GENERATE_QHP = @WITH_QHP@

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

QHP_NAMESPACE = org.doxygen.Project
QHP_NAMESPACE = org.qgis.qgis2

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

QHP_VIRTUAL_FOLDER = doc
QHP_VIRTUAL_FOLDER = qgis

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

QHG_LOCATION =
QHG_LOCATION = qhelpgenerator

# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
# will be generated, which together with the HTML files, form an Eclipse help
Expand Down
8 changes: 8 additions & 0 deletions doc/CMakeLists.txt
Expand Up @@ -31,6 +31,14 @@ IF(WITH_APIDOC)
FIND_PACKAGE(Doxygen 1.8.2 REQUIRED)
IF(DOXYGEN_FOUND)

# Whether to generate QHP file
SET (GENERATE_QHP FALSE CACHE BOOL "Determines whether to generate Qt QHP help from the QGIS API Docs")
IF (GENERATE_QHP)
SET(WITH_QHP YES)
ELSE(GENERATE_QHP)
SET(WITH_QHP NO)
ENDIF(GENERATE_QHP)

FIND_FILE(QT_TAG_FILE
NAMES qt4.tags qt4.tag qt.tags qt.tag
PATHS "${QT_DOC_DIR}"
Expand Down

0 comments on commit 45f0cff

Please sign in to comment.