Strange //! comment syntax in Quick Controls 2.0 Q

2019-01-28 07:27发布

This question already has an answer here:

While looking through Quick Controls 2.0 sources, I came upon a peculiar comment syntax that I can't seem to find in docs:

//! [property]
property: ...
...
//! [property]

for example, pairs of //! [contentItem], //! [background] could be seen in TabButton.qml.


I wonder if this is just a convention chosen by the developers to delimit regions of code, or does it indeed have some special meaning?

2条回答
迷人小祖宗
2楼-- · 2019-01-28 08:05

There used to be example code snippets on the Customizing Qt Quick Controls documentation page, that were automatically extracted from our own QML code with help of those qdoc-markers.

查看更多
来,给爷笑一个
3楼-- · 2019-01-28 08:06

With Qt comments that begin with ! are parsed to generate documentation. That applies to single and multi line comments.

In this particular case however it doesn't seem to contain any actual documentation, it is used to signify the lines where individual implementation details begin and end.

You can learn more about the documentation format here.

查看更多
登录 后发表回答