Building Qt 5 Documentation

This information is subject to change. It is very likely that this process will change in the near future.

Unlike in Qt 4, the source code for Qt 5 is provided in a set of separate repositories. In theory, this allows individual modules to be developed and built on their own instead of requiring Qt to be built in a monolithic process. At the moment, the documentation build process still assumes that a monolithic set of documentation for Qt is required, so a certain amount of preparation is required before it can be built. The instructions on this page should help you set up Qt and build a basic set of documentation.

Configuring Qt for Documentation

This is probably not the recommended way to configure Qt. It should work for the purpose of building the documentation, but you should find official instructions if you intend to develop Qt.

  1. Obtain the sources. You need at least the qtbase [qt.gitorious.org] and qtdoc [qt.gitorious.org] repositories. You may also want to obtain the other modules. Alternatively, fetch the qt5 [qt.gitorious.org] repository and run the script:
    1. ./init-repository
  2. Enter the qtbase directory and configure the library:
    1. ./configure -developer-build -nomake examples -nomake tests
  3. Build the library:
    1. make

Make sure that you have the right qmake executable in your path.

  1. export PATH=PATH_TO_QT/qtbase/bin:$PATH

With the base libraries built, we now need to register each of the modules with the build system in qtbase. Enter each module directory and configure it with the newly-built qmake tool. On Unix/Linux, do this in the following way:

  1. ../qtbase/bin/qmake

This should register each module in the mkspecs/modules directory inside qtbase.
In order to build the documentation for QtDeclarative you need to build the module since it contains a helper library for QML documentation.

Building qdoc

To build qdoc, enter the qtdoc directory and run qmake and make; for example:

  1. cd qtdoc
  2. ../qtbase/bin/qmake
  3. make

qdoc should now be built in the tools/qdoc3 directory.

Building the Documentation

Make sure that you have the right qdoc3 executable in your path. It should be in qtbase/bin, next to the qmake from Qt 5.

The build system for the qtdoc module should now be able to build the documentation. Do this by invoking the online_docs build rule:

  1. make online_docs

This should generate a set of documentation in the doc/html directory inside the qtdoc module.

Categories: