奇怪的//!Quick Controls 2.0 QML 源代码中的注释语法 [英] Strange //! comment syntax in Quick Controls 2.0 QML source

查看:21
本文介绍了奇怪的//!Quick Controls 2.0 QML 源代码中的注释语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在查看 Quick Controls 2.0 源代码时,我发现了一种在文档中似乎找不到的特殊注释语法:

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]

例如,成对的 //![内容项], //![背景] 可以在 TabButton.qml 中看到.

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?

推荐答案

对以 ! 开头的 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 源代码中的注释语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆