README
1Qt 5 Documentation
2==================
3
4New in Qt 5.0, each module has its own documentation package. The documentation
5resides in the module sources as well as the configuration files needed to build
6the module documentation. The main Qt 5.0 Reference Documentation resides in the
7qtdoc repository.
8
9There 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
14Running "make docs"
15===================
16
17To build the documentation using Makefiles, qtbase needs to be compiled and
18installed.
19
20Running 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
26Note: qch_docs needs qhelpgenerator to package the documentation. qhelpgenerator
27is in the qttools repository.
28
29These make targets use qmake's QT_INSTALL_DOCS variable as the output directory.
30Running "qmake -query" will list the directory set to QT_INSTALL_DOCS.
31
32To create all of the modules' documentation, run "make docs" in the
33qt5 directory:
34 $> make docs # builds the bundled modules' documentation
35
36It is also possible to build only a small subset of the documentation by using
37make:
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
45Running QDoc
46============
47
48QDoc is the tool for generating Qt documentation and is located in qtbase.
49The simplest way to compile QDoc is to compile qtbase or only the tools in
50qtbase.
51
52 $> cd qtbase/src
53 $> make sub-tools # compiles QDoc
54
55Each module has a QDoc configuration file (.qdocconf). To build a module's
56documentation, run the "qdoc" binary and pass the qdocconf file as a parameter.
57A 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
63Packaging the Documentation
64===========================
65
66To package the documentation, the HTML files must be compiled
67into a QCH file (.qch).
68
69Required binaries:
70 * assistant - found in qttools
71 * qhelpgenerator - found in qttools
72
73To compile the qch file for each module, first enter the output directory that
74contains 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
79The QCH file can then be loaded in Qt Assistant or Qt Creator. For Qt Assistant,
80the QCH file can be registered to automatically load it.
81
82 $> assistant -register qtdoc.qch #to automatically load the documentation
83
84
85Global Files
86============
87
88The qtbase/doc/global directory contains various files used by the modules to
89build the documentation. These include macros, stylesheets, and images for
90displaying documentation.
91
92To 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
97Documentation Structure
98=======================
99For a typical module, the documentation will reside in the source directory.
100The 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
105More Information
106================
107
108For more information about Qt 5's documentation, refer to the Qt Project wiki:
109http://wiki.qt.io/Qt5DocumentationProject
110