Using automatic documentation of my own function with Qt Creator?

26,746

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:

Windows:

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.

http://www.doxygen.nl/

http://www.doxygen.nl/manual/output.html (includes qch files)

Here is a related plugin for Qt Creator:

http://dev.kofee.org/projects/qtcreator-doxygen/wiki

And using the QHelpEngine in your own program...

http://qt-project.org/doc/qt-4.8/qthelp-framework.html

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

http://doc-snapshot.qt-project.org/4.8/qdesktopservices.html#url-handlers

Hope that helps.

Share:
26,746
Cory Klein
Author by

Cory Klein

Computer science enthusiast, open source advocate, frugality expert

Updated on July 11, 2022

Comments

  • Cory Klein
    Cory Klein almost 2 years

    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 /**<ENTER> like so:

    /**<ENTER>
    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 qch help files or something?