PDA

View Full Version : need for typedef Enum enum_type in qglobal.h



jamadagni
25th May 2007, 13:41
At line 1634 of qt-x11-opensource-src-4.2.3/src/corelib/global/qglobal.h we have:


typedef Enum enum_type;

but the word enum_type does not seem to be used anywhere in the QFlags class. Is this supposed to be a convenience? If yes, in what way? If no, an anyone tell me what this typedef is really used for?

Thanks.

jacek
25th May 2007, 17:56
but the word enum_type does not seem to be used anywhere in the QFlags class.
Are you sure?

#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) \
inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) \
{ return QFlags<Flags::enum_type>(f1) | f2; } \
inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) \
{ return f2 | f1; }