dyngoman
12th March 2010, 09:47
Hello,
I am new to Qt and C++ and just migrating from C# and .Net framework witch left me with a bitter taste in programming.
I am trying to get familiar with Qt development and came across this problem while trying to get strings from enum values.
I have used this link as a reference:
http://labs.trolltech.com/blogs/2008/10/09/coding-tip-pretty-printing-enum-values/
and used the ENUM_NAME macro defined therea as follow
QString strTag = ENUM_NAME(Cat,Cat::CatType,this->m_catType);
where Cat is the a class that inherits QObject and has the Q_OBJECT macro inside, and CatType is and enumeration
enum CatType{MAIDANEZA,CHARTREUX,PERSIAN}; parsed with the Q_ENUMS macro.
I get the following error:
cat.cpp:14:error: invalid use of incomplete type 'struct QMetaEnum'
qobjectdefs.h:240: error: forward declaration of 'struct QMetaEnum'
What could be the problem?
I am new to Qt and C++ and just migrating from C# and .Net framework witch left me with a bitter taste in programming.
I am trying to get familiar with Qt development and came across this problem while trying to get strings from enum values.
I have used this link as a reference:
http://labs.trolltech.com/blogs/2008/10/09/coding-tip-pretty-printing-enum-values/
and used the ENUM_NAME macro defined therea as follow
QString strTag = ENUM_NAME(Cat,Cat::CatType,this->m_catType);
where Cat is the a class that inherits QObject and has the Q_OBJECT macro inside, and CatType is and enumeration
enum CatType{MAIDANEZA,CHARTREUX,PERSIAN}; parsed with the Q_ENUMS macro.
I get the following error:
cat.cpp:14:error: invalid use of incomplete type 'struct QMetaEnum'
qobjectdefs.h:240: error: forward declaration of 'struct QMetaEnum'
What could be the problem?