| 1 |
Qt 5 Documentation |
| 2 |
================== |
| 3 |
|
| 4 |
New in Qt 5.0, each module has its own documentation package. The documentation |
| 5 |
resides in the module sources as well as the configuration files needed to build |
| 6 |
the module documentation. The main Qt 5.0 Reference Documentation resides in the |
| 7 |
qtdoc repository. |
| 8 |
|
| 9 |
There are two ways to build Qt documentation: |
| 10 |
* run "make docs" in qt5/ or in the repositories |
| 11 |
* run the QDoc tool for each module |
| 12 |
|
| 13 |
|
| 14 |
Running "make docs" |
| 15 |
=================== |
| 16 |
|
| 17 |
To build the documentation using Makefiles, qtbase needs to be compiled and |
| 18 |
installed. |
| 19 |
|
| 20 |
Running qmake will create make targets to build the documentation: |
| 21 |
* html_docs - builds only the HTML documentation |
| 22 |
* qch_docs - packages the HTML documentation into QCH files for Qt Creator and |
| 23 |
Qt Assistant. |
| 24 |
* docs - runs html_docs and qch_docs |
| 25 |
|
| 26 |
Note: qch_docs needs qhelpgenerator to package the documentation. qhelpgenerator |
| 27 |
is in the qttools repository. |
| 28 |
|
| 29 |
These make targets use qmake's QT_INSTALL_DOCS variable as the output directory. |
| 30 |
Running "qmake -query" will list the directory set to QT_INSTALL_DOCS. |
| 31 |
|
| 32 |
To create all of the modules' documentation, run "make docs" in the |
| 33 |
qt5 directory: |
| 34 |
$> make docs # builds the bundled modules' documentation |
| 35 |
|
| 36 |
It is also possible to build only a small subset of the documentation by using |
| 37 |
make: |
| 38 |
$> cd qtbase |
| 39 |
$> make docs # builds the documentation for modules in qtbase |
| 40 |
|
| 41 |
$> cd qtbase/src/sql |
| 42 |
$> make docs # builds only the Qt SQL documentation |
| 43 |
|
| 44 |
|
| 45 |
Running QDoc |
| 46 |
============ |
| 47 |
|
| 48 |
QDoc is the tool for generating Qt documentation and is located in qtbase. |
| 49 |
The simplest way to compile QDoc is to compile qtbase or only the tools in |
| 50 |
qtbase. |
| 51 |
|
| 52 |
$> cd qtbase/src |
| 53 |
$> make sub-tools # compiles QDoc |
| 54 |
|
| 55 |
Each module has a QDoc configuration file (.qdocconf). To build a module's |
| 56 |
documentation, run the "qdoc" binary and pass the qdocconf file as a parameter. |
| 57 |
A mandatory "outputdir" must be specified. |
| 58 |
|
| 59 |
$> qdoc doc/config/qtdoc.qdocconf -outputdir html |
| 60 |
|
| 61 |
Note that QDoc will delete the contents of the "html" output directory. |
| 62 |
|
| 63 |
Packaging the Documentation |
| 64 |
=========================== |
| 65 |
|
| 66 |
To package the documentation, the HTML files must be compiled |
| 67 |
into a QCH file (.qch). |
| 68 |
|
| 69 |
Required binaries: |
| 70 |
* assistant - found in qttools |
| 71 |
* qhelpgenerator - found in qttools |
| 72 |
|
| 73 |
To compile the qch file for each module, first enter the output directory that |
| 74 |
contains the .qhp file and generate the QCH file. |
| 75 |
|
| 76 |
$> cd qtbase/doc/qtdoc #the default path for QT_INSTALL_DOCS for qtdoc |
| 77 |
$> qhelpgenerator qtdoc.qhp #creates the QCH file called qtdoc.qch |
| 78 |
|
| 79 |
The QCH file can then be loaded in Qt Assistant or Qt Creator. For Qt Assistant, |
| 80 |
the QCH file can be registered to automatically load it. |
| 81 |
|
| 82 |
$> assistant -register qtdoc.qch #to automatically load the documentation |
| 83 |
|
| 84 |
|
| 85 |
Global Files |
| 86 |
============ |
| 87 |
|
| 88 |
The qtbase/doc/global directory contains various files used by the modules to |
| 89 |
build the documentation. These include macros, stylesheets, and images for |
| 90 |
displaying documentation. |
| 91 |
|
| 92 |
To include these files in a qdocconf, add the following to a qdocconf file: |
| 93 |
|
| 94 |
include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) |
| 95 |
|
| 96 |
|
| 97 |
Documentation Structure |
| 98 |
======================= |
| 99 |
For a typical module, the documentation will reside in the source directory. |
| 100 |
The examples and the example documentation are in the "examples" directory. |
| 101 |
|
| 102 |
qtbase/src/sql/doc/src #Qt SQL's documentation |
| 103 |
qtbase/examples/sql #Qt SQL's examples |
| 104 |
|
| 105 |
More Information |
| 106 |
================ |
| 107 |
|
| 108 |
For more information about Qt 5's documentation, refer to the Qt Project wiki: |
| 109 |
http://wiki.qt.io/Qt5DocumentationProject |