Results 1 to 2 of 2

Thread: [SOLVED] Q_ENUMS from another class inside a plugin

  1. #1
    Join Date
    Jul 2006
    Posts
    37
    Thanks
    6
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Question [SOLVED] Q_ENUMS from another class inside a plugin

    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:

    Qt Code:
    1. class motherClass: public QObject
    2. {
    3. public:
    4. motherClass();
    5. ~motherClass();
    6.  
    7. enum toto{titi, tata};
    8. toto _myToto;
    9.  
    10. };
    11.  
    12. class CLASS2: public QObject
    13. {
    14. Q_OBJECT
    15. Q_ENUMS(motherClass::toto)
    16. Q_PROPERTY( motherClass::toto toto READ toto WRITE settoto)
    17.  
    18. public:
    19.  
    20. CLASS2( QWidget * parent = 0){ myMotherClass = new motherClass;}
    21. ~CLASS2();
    22.  
    23. void settoto ( motherClass::toto);
    24. motherClass::toto toto () const { return myMotherClass->_myToto;}
    25. motherClass* myMotherClass;
    26.  
    27. };
    To copy to clipboard, switch view to plain text mode 


    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
    Last edited by desch; 1st December 2007 at 15:58.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Q_ENUMS from another class inside a plugin

    Q_ENUMS has to be declared inside motherClass. Then you can use it for a property type inside some other class.

  3. The following user says thank you to wysota for this useful post:

    desch (1st December 2007)

Similar Threads

  1. QPluginLoader not recognizing a plugin
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 29th June 2007, 14:13

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.