//!Qt源代码中的[0]
//! [0] in Qt source code
Qt示例项目中C++/QML源中的//! [n]
(n
=0,1,2…)标记的含义是什么?
例如:
//! [0]
GLWidget::GLWidget(Helper *helper, QWidget *parent)
: QGLWidget(QGLFormat(QGL::SampleBuffers), parent), helper(helper)
{
elapsed = 0;
setFixedSize(840, 400);
setAutoFillBackground(false);
}
//! [0]
//! [1]
void GLWidget::animate()
{
elapsed = (elapsed + qobject_cast<QTimer*>(sender())->interval()) % 1000;
repaint();
}
//! [1]
//! [2]
void GLWidget::paintEvent(QPaintEvent *event)
{
QPainter painter;
painter.begin(this);
painter.setRenderHint(QPainter::Antialiasing);
helper->paint(&painter, event, elapsed);
painter.end();
}
//! [2]
尽管有常见的误解,但这是qdoc语法,而不是doxygen。此注释用于Qt项目中的文档目的,以标记要呈现的示例代码段。请参阅文档和实现此功能的相应代码。
作为Qt的最终用户,你不需要过多地处理它,除非你开始为Qt项目本身做出贡献,或者你正试图为自己的项目重用qdoc,这在这一点上是不可否认的奇怪。
相关文章:
- Qt Quick,如何更改 Ui 源代码?
- 如何使用QT创建器获取网页源代码?
- 为什么Qt必须从源代码构建以进行交叉编译?
- 尝试使用 MSVC 从源代码构建 qt 创建器:无法打开包含文件:"stddef.h":没有这样的文件或目录
- Qt 5 中源代码外构建的链接器错误
- 如何处理Qt源代码中带有"±"的GUI字符串?
- 如何将Paraview源代码编译到QT项目(.pro)
- 从MACOS上的源代码构建QT时错误
- 从源代码构建Qt 5.8 - 配置:未知命令行选项'-c++11'
- 加载图像函数在qt快速源代码
- QT应用程序崩溃但不容易复制,我捕获了转储堆栈以及如何通过堆栈找到源代码
- 从代码内部编译QT源代码
- 是QT源代码完成
- 从 ARM 源代码编译 Qt 4.7 的问题
- Qt自动生成的表单提供了错误的源代码文件路径
- 从源代码构建Qt静态,启用OpenSSL支持
- //!Qt源代码中的[0]
- Qt源代码是如何组织的
- 编译Qt工具的Qt源代码树
- 在64位Debian环境下编译32位qt源代码