Question

I have a project with use Qt extensively. The documentation is generated with doxygen. Is it possible to configure doxygen to generate links to online qt documentation.

For example,

/**
 * Implements QAbstractListModel.
 */

The comment like this would have in the output an internet link to Qt online documentation of QAbstractListModel.

Was it helpful?

Solution

You can use the TAGFILES option on your Doxyfile then you can setup the online link as TAGFILE. See:

TAGFILES = qtcore.tags=http://qt-project.org/doc/qt-4.8/ \
qtgui.tags=http://qt-project.org/doc/qt-4.8/ \
qtwidgets.tags=http://qt-project.org/doc/qt-4.8/ \
qtxml.tags=http://qt-project.org/doc/qt-4.8/ \
qtnetwork.tags=http://qt-project.org/doc/qt-4.8/

More information here: Linking to external documentation

I was looking on internet about that and in fact I couldn't find the answer. I just tried it and it worked so great for me!!!

OTHER TIPS

Is it possible to configure doxygen to generate links to online qt documentation.

It would have been important for the KDE API documentation, too, but there is no, or at least not a simple way to do it.

However, as you can see on the KDE API page (e.g. KMessageBox and grep for QWidget), you can apply some tricks to at least the method signature, etc, to get the link to the Qt documentation. Perhaps, you could try to apply the same trick to the documentation without doxygen.

In general, you wish to have more than just the doxygen documentation, so I think you would need a more generic approach, respectively.

I wrote a utility to copy the .tags files from selected module(s) in a Qt docs install folder and place them somewhere local to the Doxygen config. It will optionally concatenate the input files into one big .tags file so the Doxygen config becomes much simpler if linking to online help (vs. generating a .qhp).

If I have:

project/
  doc/
    Doxyfile
    html/
    tagfiles/
      qt.tags
  src/

The single file can be used like so:

TAGFILES = tagfiles/qt.tags=https://doc.qt.io/qt-5/

Or for QHP:

TAGFILES = \
     tagfiles/qtcore.tags=qthelp://org.qt-project.qtcore/qtcore/  \
     tagfiles/qtgui.tags=qthelp://org.qt-project.qtgui/qtgui/     \
     tagfiles/qtwidgets.tags=qthelp://org.qt-project.qtwidgets/qtwidgets/ 

Here's an example of docs generated from that repo. All the linking to Qt docs is automatic, including all the inherited stuff in the expandable trees.

Adding the large Qt tags noticeably slows down Doxygen runs, so I would definitely limit the imported tags to only the Qt modules one needs to link to.

UPDATE: There is a bug (QTBUG-61790) (fixed in Qt 5.15.0) in Qt's generation of tags for enumeration values which prevents Doxygen from generating proper links to them. I added a separate utility which fixes the tag files, and also updated the copy utility I linked to at the top to implement the enum fixes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top