Using C++ reference Documentation in Qt Creator

Published:

First blog post in a long time with a quick tip.

In this post I will demonstrate how-to use the C++ reference documentation in the Qt Creator Integrated Development Environment (IDE).

Hint: Other than the name of the IDE suggests, Qt Creator can be used without the Qt library. In my opinion it is the best open-source C++ IDE available at the moment (e. g. it nicely integrates with the CMake build system).

Qt Creator

I recommend the excellent C++ reference over the often mentioned documentation on cplusplus.com. cplusplus.com is not as bad as a reference, but the example C++ source code together with the tutorials does not have a high quality.

To use the Application Programming Interface (API) documentation from C++ reference.com in Qt Creator]3, the following steps have to be done:

  1. Download the Open Source version of Qt Creator from the official Download Qt website. The latest version is 3.3.0 (e. g. qt-creator-opensource-windows-x86-3.3.0.exe if using Microsoft Windows) at the point of writing this article.
  2. Install the downloaded Qt Creator installation file.
  3. Download the Qt help book (file extension qch) from the offical Archives for offline viewing - cppreference.com website. The latest version is 2014-11-18 (archive file qch_book_20141118.zip) at the point of writing this article.
  4. Extract the Qt help book file cppreference-doc-en-cpp.qch from the archive file qch_book_20141118.zip and copy it to the Qt Creator installation directory (e. g. C:\Qt\qtcreator-3.3.0 if using Microsoft Windows).
  5. Start Qt Creator.
  6. Select Tools -> Options… from the menu bar to open the Options dialog.
  7. Select the tab Documentation under Help and click the Add… button to open the Add Documentation dialog.
  8. Select the Qt help book file (qch) copied to the installation directory of Qt Creator and select the Open button to close the Add Documentation dialog.
  9. Finally select the OK button to close the Options dialog.

The following two screenshots show the difference without and with the C++ reference Qt help book used by Qt Creator.

  • Before:
Documentation in Qt Creator before installation of the C++ reference Qt help book
  • After:
Documentation in Qt Creator after installation of the C++ reference Qt help book

In my opinion this adds a lot to the usefulness of the Qt Creator IDE, since I do not have to switch between the IDE and a web browser to read documentation.

Other Qt help books are also available and listed on the website Qt Creator Documentation Gallery.