Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using automatic documentation of my own function with Qt Creator?

Tags:

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?

like image 268
Cory Klein Avatar asked Jul 30 '13 19:07

Cory Klein


People also ask

What is .UI file in Qt?

ui file is used to create a ui_calculatorform. h file that can be used by any file listed in the SOURCES declaration. Note: You can use Qt Creator to create the Calculator Form project. It automatically generates the main.

Is Qt Creator a good IDE?

QtCreator is stable enough and a comfortable IDE, although compile/debug cycles are slower on Windows than with Visual Studio. It doesn't have all the fancy features Visual Studio offers, but after using it for a while I just realized I wasn't missing them.

What is the difference between Qt and Qt Creator?

Qt creator can't build and debug any code (except perhaps, you want to use it for other reasons) without Qt because Qt contains the necessary tools for that purpose. So download Qt Creator alone if you already have Qt or want to update your old Qt creator and download Qt 5.4.

Should I use Qt Creator or Visual Studio?

In the end it comes down to preferences if you want to use Qt Creator or Visual Studio for development. It is easy to create a VS project file from Qt project files using qmake. I prefer using Qt Creator because I can navigate a lot faster. My colleague, however, uses Visual Studio.


1 Answers

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.

like image 139
phyatt Avatar answered Sep 22 '22 19:09

phyatt