c++ - Doxygen 与 Qt 定义

标签 c++ qt c++11 doxygen

我有这样的类定义:

class A Q_DECL_FINAL: public QThread

doxygen 解析不正确的问题!我在 doxygen 文档和图表中的类调用 Q_DECL_FINAL。我该如何解决?

最佳答案

假设你有这个:

class MovableLabel Q_DECL_FINAL: public QLabel

要忽略 Q_DECL_FINAL(在 doxygen 中),您应该使用 next:

class MovableLabel /** @cond */ Q_DECL_FINAL /** @endcond */: public QLabel

在这种情况下,您将在 doxygen 生成的文档中获得正确的类名,并在编译期间获得 Q_DECL_FINAL 的真实含义,因此 next 将无法运行:

class Der : MovableLabel //error
{

};

Q_DECL_FINAL 也不是 typedef。它是这样的:

#ifdef Q_COMPILER_EXPLICIT_OVERRIDES
# define Q_DECL_OVERRIDE override
# define Q_DECL_FINAL final //here our keyword
#else
# ifndef Q_DECL_OVERRIDE
#  define Q_DECL_OVERRIDE
# endif
# ifndef Q_DECL_FINAL
#  define Q_DECL_FINAL //just nothing, if c++11 not enabled
# endif
#endif

Q_COMPILER_EXPLICIT_OVERRIDES 是:

#    if __has_feature(cxx_override_control)
#      define Q_COMPILER_EXPLICIT_OVERRIDES
#    endif

Code from here.

关于c++ - Doxygen 与 Qt 定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32051541/

相关文章:

C++:按值传递变量

c++ - Qt中如何使用静态槽函数?

c++ - pretty-print 类型和类模板及其所有模板参数

c++ - VS2012 中的 emplace_back 和 shared_ptr vector

c++ - 遍历映射并将该对用作引用参数 C++11

c++ - 我可以使用指针访问多维数组吗?

c++ - 将巨大的二维 vector 写入文本文件太慢,如何提高性能?

c++ - AddressSanitizer GCC 4.8 双重释放错误

qt - 如何查看独立 qml 应用程序的控制台输出?

c++ - 使用自定义委托(delegate)通过 TableView 编辑 QStandardItemModel