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

为君一笑 提交于 2020-01-04 02:12:27

问题


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:

Is this some convention? What does the blue signify?


回答1:


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 ...



回答2:


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.



来源:https://stackoverflow.com/questions/22730001/why-are-comments-that-start-with-colored-blue-in-qt-creator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!