上下文命令
上下文命令提供了关于正在编写文档的元素的信息,而这些信息是 QDoc 无法自行推断出来的。例如:
- 该类是否线程安全?
- 该函数是否可重入?
- 该类属于哪个模块?
- 使用该类需要哪个 #include 语句?
上下文命令可以出现在 QDoc 注释的任何位置,但通常应置于注释开头附近,紧跟在topic命令之后。
- \abstract
- \attribution
- \cmakecomponent
- \cmakepackage
- \cmaketargetitem
- \compares (自 QDoc 6.7 起)
- \compareswith (自 QDoc 6.7 起)
- \default
- \deprecated
- \ingroup
- \inheaderfile
- \inherits
- \inmodule
- \internal
- \modulestate (自 QDoc 6.5 起)
- \nextpage
- \nonreentrant
- \overload
- \preliminary
- \previouspage
- \qmlabstract
- \qmldefault
- \qmlenumeratorsfrom (自 QDoc 6.8 起)
- \qtcmakepackage
- \qtcmaketargetitem
- \readonly
- \reentrant
- \reimp
- \relates
- \required
- \since
- \startpage
- \subtitle
- \threadsafe
- \title
- \toc (自 QDoc 6.11 起)
- \tocentry (自 QDoc 6.11 起)
- \wrapper
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.