Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are comments that start with "//!" colored blue in Qt Creator?

Qt Creator normally colors comments green, but I saw blue colored comments in the Qt Examples, and Qt Creator seems to color every comment that starts with //! in blue.

Here's an example screenshot:

enter image description here

Is this some convention? What does the blue signify?

like image 377
sashoalm Avatar asked Dec 13 '25 13:12

sashoalm


2 Answers

It's a Doxygen comment.

There are multiple styles:

Qt block comment:

/*!
... text ...
*/

Qt one-line comment:

//! ... one line of text ...

JavaDoc block comment:

/**
  * ... text ...
*/

JavaDoc one-line comment:

/// ... one line of text ...
like image 83
cf stands with Monica Avatar answered Dec 16 '25 02:12

cf stands with Monica


Comments that begin with //! are the Qt style for code documentation as contrasted with regular comments. See the doxygen manual for details on the structure of it, but basically, these kinds of comments are intended for automatic extraction into documentation about the code.

like image 35
Edward Avatar answered Dec 16 '25 02:12

Edward



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!