Important: Please read the Qt Code of Conduct -

QtCreator qch doxygen code tags

  • Hello,
    I stumbled upon problem with doxygen tag \code that is inside source file.
    When generating HTML output I can see correctly example code, line by line correctly placed in HTML output), but when loading generated gch into QtCreator all example code is in one line without any indention, although I do see that code documentation style is applied but with x position of 0.
    Using \verbatim do resolve this, but varbatim is used for different purpose.

    Used version:
    QtCreator - 3.6.1
    doxygen - 1.8.11

  • Lifetime Qt Champion


    Can you show an sample comment code that triggers that ?

  • Sorry for late reply.
    Here are screens from both HTML and QtCreator.



    I used custom config for doxygen, but with default one + enable QCH output in QtCreator is same.
    Seams like in QtC style for code is messed up.

  • Lifetime Qt Champion

    Can you test something ? Remove the * from the lines that are not the start nor stop of the comment block.

  • Same result, code is in one line.
    Tried removing * also from \code tags (and end) -also didn't helped.

  • The only thing that stands out to me is your use of \brief. That command is handled differently between QDoc and Doxygen - indeed, the wording of you comment suggests that you're expecting Doxygen's QT_AUTOBRIEF option to be enabled, yet the image you've attached suggests that option is not in affect (possibly because of your explicit \brief).

    Anyway, try either:

    • removing the \brief; and/or
    • adding a blank link between the \brief line, and the "more detailed description" line.

    It probably should work fine the way you have it, but give that a go anyway, just to see if that's the source of the issue.


  • Yes auto brief is enabled in config also.
    Tried above suggestion, result is same code is in one line.

    What I tried and didn't helped:

    • removal of \brief
    • removal of * at beginning of the line
    • putting comment in to /** ... / instead of /! ... */

  • Lifetime Qt Champion

    Can you share your doxygen config ? And which version is it ?

  • doxygen 1.8.11
    Qt 5.6 QtCreator 3.6.1

    doxy config:!09tB3JgK!Z102QbGp-MetJ7O0-vdkq5uJmPVJWdngJj_VQrdMT1M

    Tried with default generated by doxy, only enable QCH same result.

  • @SGaist I think the problem is related to the recent change of qt creator since version 3.6.1: the help browser's default showing widget is no longer QtWebkit, but QTextBrowser, which only implements a subset of css style. Please refer to this post

Log in to reply