PDA

View Full Version : [SOLVED] Q_ENUMS from another class inside a plugin



desch
1st December 2007, 15:02
Hi Everybody,

I try to set an Enum as property inside Qt Designer using an Enum coming from another aggregate class: this is the code I try to achieve:


class motherClass: public QObject
{
public:
motherClass();
~motherClass();

enum toto{titi, tata};
toto _myToto;

};

class CLASS2: public QObject
{
Q_OBJECT
Q_ENUMS(motherClass::toto)
Q_PROPERTY( motherClass::toto toto READ toto WRITE settoto)

public:

CLASS2( QWidget * parent = 0){ myMotherClass = new motherClass;}
~CLASS2();

void settoto ( motherClass::toto);
motherClass::toto toto () const { return myMotherClass->_myToto;}
motherClass* myMotherClass;

};


I try a lot of things but doesn't succeed to see the "toto" property with choice Enum toto inside Designer

If someone has an idea

Great Thanks

David

wysota
1st December 2007, 15:44
Q_ENUMS has to be declared inside motherClass. Then you can use it for a property type inside some other class.