Maxim
Maxim

Reputation: 89

Doxygen with Qt defines

I have class definition like:

class A Q_DECL_FINAL: public QThread

Problem that doxygen parses that incorrect! My class in doxygen docs and diagrams calls Q_DECL_FINAL. How can I fix that?

Upvotes: 1

Views: 170

Answers (1)

Jablonski
Jablonski

Reputation: 18524

Suppose you have this:

class MovableLabel Q_DECL_FINAL: public QLabel

To ignore Q_DECL_FINAL (in doxygen) you should use next:

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

In this case you will get correct class name in doc generated by doxygen and true meaning of Q_DECL_FINAL during compilation, so next will not work:

class Der : MovableLabel //error
{

};

Also Q_DECL_FINAL is not a typedef. It is something like:

#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

And Q_COMPILER_EXPLICIT_OVERRIDES is:

#    if __has_feature(cxx_override_control)
#      define Q_COMPILER_EXPLICIT_OVERRIDES
#    endif

Code from here.

Upvotes: 3

Related Questions