用Qt定义Doxygen

时间:2015-08-17 13:21:10

标签: c++ qt c++11 doxygen

我的课程定义如下:

class A Q_DECL_FINAL: public QThread

doxygen解析错误的问题!我在doxygen文档和图表中的课程调用了Q_DECL_FINAL。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:3)

假设你有这个:

class MovableLabel Q_DECL_FINAL: public QLabel

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

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

在这种情况下,您将在doxygen生成的doc中获得正确的类名,并在编译期间获得Q_DECL_FINAL的真实含义,因此接下来将不起作用:

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.