Strange //! comment syntax in Quick Controls 2.0 QML source [duplicate]

僤鯓⒐⒋嵵緔 提交于 2019-11-28 09:09:09

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/40347224/strange-comment-syntax-in-quick-controls-2-0-qml-source

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