Thanks for the input. I'm just using ints for now but I would love to have it a proper enum because of the information conveyed.
________________________________ From: Alan Ezust <alan.ez...@gmail.com> To: Jason H <scorp...@yahoo.com> Cc: Interests Qt <interest@qt-project.org> Sent: Thursday, February 13, 2014 1:38 PM Subject: Re: [Interest] Using another Class's enum in your class (crickets chirp) I was wondering if anyone was going to tackle this. It's a question I often asked. And in finding an answer, I looked at the Qt source code. Which may have been a bad idea. With the exception of the "Qt" namespace, that's what Qt does itself, using int instead of the enum from another Q_OBJECT class. The way Qt put Q_ENUMS into the Qt namespace is by pretending it is a QObject when moc processes it and pretending it is a namespace when it is compiled by the compiler. Which is a bit of a hack. Another idea is to put all the Q_ENUMS in the most basey of base classes and have all of your other classes inherit from that class and then you can use the Q_ENUM in all the derived types. I ended up writing my own Enum class that converts to/from int and QString and using that instead of Q_ENUMS for these kind of situations. I don't know the best answer to your question. I was hoping someone else would say something. On Wed, Feb 12, 2014 at 6:38 AM, Jason H <scorp...@yahoo.com> wrote: The Q_ENUMS() macro will do what I want -- for QObject derived class enums. But what does one do about an enum that is not QObject derived? > > > >Q_PROPERTY(int/*QImage::Format*/ imageFormat READ imageFormat WRITE >setImageFormat); //works >Q_PROPERTY(QImage::Format imageFormat READ imageFormat WRITE setImageFormat) >//causes bad moc code >---bad code-------- >static const QMetaObject*qt_meta_extradata_VideoSurface[]={ >&QImage::staticMetaObject, // "staticmetaObject is not a member of QImage" >0 >}; >------------------------- > >For now I'm just using an int. What should I be doing? > >_______________________________________________ >Interest mailing list >Interest@qt-project.org >http://lists.qt-project.org/mailman/listinfo/interest > _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest