Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Qt Creator to show pop-up documentation of my functions the same way it does for the functions from the Qt library?

Tags:

qt

qt-creator

When you place the mouse pointer over any Qt function/class it shows a pop-up with short description of what it does, taken from the docs in the comment above the function/class.

For my functions/classes I have documentation in the doxygen format:

/**
  Returns foo
*/
QString getFoo() {
  return "foo";
}

When this function is used, I want to view the same type of pop-up with my docs when the mouse pointer is over the function name.

Is it possible to do that with Qt Creator?

like image 398
Hristo Hristov Avatar asked Dec 13 '11 12:12

Hristo Hristov


2 Answers

Unfortunately it's not possible for Qt Creator (as of the recently release 2.4) to pick up the tags on-the-fly. However, what might work is to let doxygen run, and tell it to create qch files. If you register the created qch file, you should get mouse-over and even a proper help file. See http://www.ogre3d.org/tikiwiki/Integrating+API+documentation+into+Qt+Creator+Help for how Ogre3D does it. YMMV if that's worth it for a fast-changing project. It's certainly a good idea for a (semi-)stable library.

Relevant bug report: https://bugreports.qt.io/browse/QTCREATORBUG-4557

like image 125
danimo Avatar answered Sep 21 '22 05:09

danimo


Qt Creator requires the generated docs to have some special markers in order to retrieve the tooltip text. I couldn't find a way to insert these markers with Doxygen so I've created a simple script to do it:

https://github.com/mmmarcos/doxygen2qtcreator

It's not bulletproof but it allows us to integrate our classes and methods briefs into Qt Creator tooltips.

like image 23
Marcos Avatar answered Sep 18 '22 05:09

Marcos