问题描述
在查看Quick Controls 2.0源时,我发现了一个奇怪的注释语法,我在docs中似乎找不到:
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]
例如, //! [contentItem]
, //! [background]
可在 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?
推荐答案
使用以!
开头的Qt注释来解析生成文档。这适用于单行和多行注释。
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.
这篇关于奇怪//! Quick Controls 2.0 QML源中的注释语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!