Results 1 to 2 of 2

Thread: need for typedef Enum enum_type in qglobal.h

  1. #1
    Join Date
    Jan 2006
    Location
    11 N 78 E
    Posts
    110
    Thanks
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default need for typedef Enum enum_type in qglobal.h

    At line 1634 of qt-x11-opensource-src-4.2.3/src/corelib/global/qglobal.h we have:

    Qt Code:
    1. typedef Enum enum_type;
    To copy to clipboard, switch view to plain text mode 

    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.
    Penguin #395953 using Qt for open-source development on X11 using C++ and
    Python via PyQt

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: need for typedef Enum enum_type in qglobal.h

    Quote Originally Posted by jamadagni View Post
    but the word enum_type does not seem to be used anywhere in the QFlags class.
    Are you sure?
    Qt Code:
    1. #define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) \
    2. inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) \
    3. { return QFlags<Flags::enum_type>(f1) | f2; } \
    4. inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) \
    5. { return f2 | f1; }
    To copy to clipboard, switch view to plain text mode 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.