From 45f0cff256e7b826847ba5a37d53bb0814fb782c Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Sat, 30 Apr 2016 10:15:09 +1000 Subject: [PATCH 1/2] 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 --- cmake_templates/Doxyfile.in | 8 ++++---- doc/CMakeLists.txt | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cmake_templates/Doxyfile.in b/cmake_templates/Doxyfile.in index 6c51fff2470..5e6ecc895db 100644 --- a/cmake_templates/Doxyfile.in +++ b/cmake_templates/Doxyfile.in @@ -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. @@ -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 @@ -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 diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 1a5ac054d4c..c982c7a96a1 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -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}" From 9d59f9ce767b03e7408e90133c28454bcc7520e3 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Thu, 19 May 2016 14:52:33 +1000 Subject: [PATCH 2/2] Generate QCH compiled help with qgis-api-doc package --- cmake_templates/Doxyfile.in | 2 +- debian/control.in | 1 + debian/rules | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake_templates/Doxyfile.in b/cmake_templates/Doxyfile.in index 5e6ecc895db..060c63fe01d 100644 --- a/cmake_templates/Doxyfile.in +++ b/cmake_templates/Doxyfile.in @@ -976,7 +976,7 @@ GENERATE_QHP = @WITH_QHP@ # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. -QCH_FILE = +QCH_FILE =../qch/qgis.qch # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see diff --git a/debian/control.in b/debian/control.in index 6d98ddc9b43..ed57cba6ea6 100644 --- a/debian/control.in +++ b/debian/control.in @@ -62,6 +62,7 @@ Build-Depends: xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable, #oracle# oracle-instantclient12.1-devel, spawn-fcgi, lighttpd, poppler-utils, locales, qt4-doc-html, + qt4-dev-tools, libqt4-sql-sqlite, python-psycopg2 Build-Conflicts: libqgis-dev, qgis-dev #sid stretch xenial#Standards-Version: 3.9.7 diff --git a/debian/rules b/debian/rules index bc2030d466d..a64c252f90b 100755 --- a/debian/rules +++ b/debian/rules @@ -65,6 +65,7 @@ CMAKE_OPTS := \ -DSERVER_SKIP_ECW=TRUE \ -DQGIS_CGIBIN_SUBDIR=/usr/lib/cgi-bin \ -DWITH_APIDOC=TRUE \ + -DGENERATE_QHP=TRUE \ -DWITH_CUSTOM_WIDGETS=TRUE \ -DWITH_GLOBE=TRUE \ -DWITH_INTERNAL_HTTPLIB2=FALSE \