jecjackal
jecjackal

Reputation: 1437

QT Style Comments (Intellisense?)

I noticed in 2.1 of QTCreator, that they now have a sort of intellisense similar to that of Visual Studio. I know intellisense is Microsoft's name for this concept of the helpful tooltip that pops up giving you a description of the method, parameters etc so i don't know what this is actually called. Does anyone know how to add these type of pop-up comments to methods and classes in QT?

Again to clarify what i'm talking about are like javadoc comments or the "///" in C#. I'm hoping the devs of QT have a way for the users to make their own comments.

Thanks for the help,

Jec

Upvotes: 4

Views: 2656

Answers (1)

Rian Sanderson
Rian Sanderson

Reputation: 6702

I've been wanting to do this as well.

I found this thread over on qtCentre.org where someone has integrated their own docs into the QT Creator Tooltips. I haven't tested it myself, but it sounds reasonable:

http://www.qtcentre.org/archive/index.php/t-40324.html?s=98d48c38547da14b0725e5106d83c315

To use your own documentation in Qt Assistant (and in Qt Creator help as well) you need to create Qt Compressed Help file (.qch (http://doc.qt.nokia.com/4.7/assistant-custom-help-viewer.html#displaying-custom-documentation)) and register it in Assistant and Creator. Doxygen has several tools exactly for Qt. There are tags in it's config file, that help you to create the documentation exactly the way you need. E.g. with GENERATE_QHP tag you can make it create the ready qhp (http://doc.qt.nokia.com/4.7/assistant-custom-help-viewer.html#creating-a-custom-help-collection-file) (Qt Help Project) file (you need this to generate the .qch). If you don't need to edit this file manually before creating the .qhc, you can set the value of QHG_LOCATION tag to the location of your qhelpgenerator.exe (usually it's here (in Windows): /mingw/bin/qhelpgenerator.exe) and it will generate the ready documentation. Register it in Qt Assistant (optional) and Creator and you're done. After this all your documented types, functions, members, etc. will have the tooltip with F1 button hint. And of course pushing F1 will show your documented help for it.

Upvotes: 1

Related Questions