Cory Klein Cory Klein - 2 months ago 21
C++ Question

Using automatic documentation of my own function with Qt Creator?

I was using Qt Creator and I decided I wanted to document a function I had written so I positioned my cursor above my function definition and typed

like so:

void MyClass::myFunction(int myArg)

Qt Creator auto-expanded that comment:

* @brief MyClass::myFunction
* @param myArg
void MyClass::myFunction(int myArg)

What is this? Where is it documented?

Can I use this to generate my own Qt Assistant
help files or something?


It should be documented here or here, but its not...

So here is some info about it:

The settings for this feature are found here:


Qt Creator > Tools > Options > Text Editor > Completion > Documentation Comments

Mac OS X:

Qt Creator > Preferences > Text Editor > Completion > Documentation Comments

The three options it lists are:

  • Enable Doxygen blocks
  • Generate brief description
  • Add leading asterisks

(Found in Qt 2.6, but possibly in earlier versions, too?, or it may be part of the default plugin set at some point.)

The stubs that are created are Doxygen style stubs.

You can use doxygen to run through your source code and create some fancy documentation, both in a chm file and in a html document and pdf. (includes qch files)

Here is a related plugin for Qt Creator:

And using the QHelpEngine in your own program...

And finally, you can use QDesktopServices to handle a help styled url:

Hope that helps.