Results 1 to 6 of 6

Thread: "has a relation" to work with designer ?

  1. #1

    Default "has a relation" to work with designer ?

    Hi all...

    if i have the following code fragment :

    Qt Code:
    1. //
    2. //
    3. class QDESIGNER_WIDGET_EXPORT CTest : public QObject
    4. {
    5. Q_OBJECT
    6. //
    7. Q_PROPERTY( QString TestString READ getTestString WRITE setTestString )
    8. public:
    9. //
    10. CTest()
    11. {
    12. };
    13. ~CTest()
    14. {
    15. };
    16. CTest& operator= ( CTest& v)
    17. {
    18. TestString = v.getTestString();
    19. return *this;
    20. };
    21. QString getTestString () { return TestString; };
    22. void setTestString( QString value ) { TestString = value ; };
    23. protected:
    24. //
    25. private:
    26. //
    27. QString TestString;
    28. };
    29. //
    30. class QDESIGNER_WIDGET_EXPORT EQtDataView : public QWidget
    31. {
    32. Q_OBJECT
    33. //
    34. Q_PROPERTY( QString ExportIdOffset READ getExportIdOffset WRITE setExportIdOffset )
    35. //
    36. Q_PROPERTY( QString ClearParamID READ getClearParamID WRITE setClearParamID )
    37. //
    38. Q_PROPERTY( QString DataSource0ID READ getDataSource0ID WRITE setDataSource0ID )
    39. Q_PROPERTY( QString DataSource1ID READ getDataSource1ID WRITE setDataSource1ID )
    40. Q_PROPERTY( QString DataSource2ID READ getDataSource2ID WRITE setDataSource2ID )
    41. Q_PROPERTY( QString DataSource3ID READ getDataSource3ID WRITE setDataSource3ID )
    42. //
    43. Q_PROPERTY( QColor BackgroundColor READ getBackgroundColor WRITE setBackgroundColor )
    44. Q_PROPERTY( QColor GridColor READ getGridColor WRITE setGridColor )
    45. //
    46. Q_ENUMS( ePlotMode )
    47. Q_PROPERTY( ePlotMode PlotMode READ getPlotMode WRITE setPlotMode )
    48. //
    49. Q_PROPERTY( CTest MyTest READ getMyTest WRITE setMyTest )
    50. public:
    51. //
    52. CTest MyTest;
    53. CTest& getMyTest()
    54. {
    55. return MyTest;
    56. };
    57. void setMyTest( CTest& value )
    58. {
    59. MyTest = value;
    60. };
    61. //
    To copy to clipboard, switch view to plain text mode 
    Would one not expect the properties of CTest to show up in the designer ?
    Am i doing something completely wrong here ?

    All the other properties of the dataview ARE displayed in the designer.

    Thanks for any help !
    Last edited by jpn; 4th December 2007 at 16:44. Reason: missing [code] tags

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: "has a relation" to work with designer ?

    Did you write a designer plugin for it?
    J-P Nurmi

  3. #3

    Default Re: "has a relation" to work with designer ?

    Yes for the dataview i did..... The data view component is available/displayed in the designer. The Q_PropertY of the dataview are visible in the designer....
    The Q_PropertY of the CTest are not.....

    Do i have to add plugin code for the CTest as well for this to work ?

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: "has a relation" to work with designer ?

    I think you'll need to implement a QDesignerPropertySheetExtension to give the property sheet a chance to represent custom class of yours.
    J-P Nurmi

  5. #5

    Default Re: "has a relation" to work with designer ?

    you mean for the CTest class ?

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: "has a relation" to work with designer ?

    No, I mean that you should provide a property sheet extension for the EQtDataView-plugin. Qt Designer is unable to handle EQtDataView's property which is of custom type, namely CTest. You will have to tell Qt Designer how to handle such property via property sheet extension.
    J-P Nurmi

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.