How to show API documentation in QtCreator hints?

QtCreator provides tooltips for Qt's built-in functions, for example:

enter image description here

I added some documentation to my own function as follows:

/** * @brief serialize Writes the passed field definition set to the specified device. * @param device Device to write the field definition set to. * @param fieldDefinitionSet Field definition set to write. */ void serialize(QIODevice& device, const FieldDefinitionSet& fieldDefinitionSet) const; 

Starting Doxygen and qhelpgenerator, I created my own .qhp file and added it to QtCreator. However, QtCreator still does not show my brief summary in a tooltip:

enter image description here

I assume that QtCreator basically recognized my .qhp file, because pressing F1 shows the generated documentation:

enter image description here

Is there a way to get brief summaries in tooltips? I tried everything in

but still no resume.

+6
source share
1 answer

The way QtCreator extracts information from HTML documentation files requires a very specific structure to work.

For example, a brief summary of MyClass should be placed between the <!-- $$$MyClass-brief --> and <!-- $$$MyClass --> marks in the corresponding HTML file. To search for a summary of methods, more complex labels are used.

Without this, a quick extract will not work, and a summary will not be displayed in QtCreator prompts.

Unfortunately, this is not well documented, and AFAIK may change in future releases.

If you're really interested, you can take a look at the sources of QtCreator ( htmldocextractor.cpp ). And I believe that Qt's help files (inside the Qt / Docs directory) can be considered working examples.

You can also try: doxygen2qtcreator .

the script inserts these Qt characters into the HTML files created by Doxygen (thus, before creating the qch file with qhelpgenerator). This worked for me, but I have not tested it with newer versions of Doxygen / Qt.

0
source

All Articles