On quinta-feira, 14 de julho de 2016 12:04:06 PDT Hamish Moffatt wrote: > The following doesn't work (on Qt 5.5.1 or 5.6); it compiles, but > object->metaObject()->enumeratorCount() reports there are none. The enum > values are not in the MOC output.
Here's an even uglier solution: > #include <QObject> > #ifdef Q_MOC_RUN class NewEnumWrapper : public QObject { #endif > enum OldEnum > { > VAL1, > VAL2, > VAL3 > }; > #ifndef Q_MOC_RUN > class NewEnumWrapper : public QObject > { #endif > Q_OBJECT > > public: > using Enum = ::OldEnum; // also tried typedef, no change > Q_ENUM(Enum) > }; -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest