我的课程定义如下:
class A Q_DECL_FINAL: public QThread
doxygen
解析错误的问题!我在doxygen
文档和图表中的课程调用了Q_DECL_FINAL
。我该如何解决这个问题?
答案 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