"has a relation" to work with designer ?
Hi all...
if i have the following code fragment :
Code:
//
//
class QDESIGNER_WIDGET_EXPORT CTest
: public QObject{
Q_OBJECT
//
Q_PROPERTY( QString TestString READ getTestString WRITE setTestString
) public:
//
CTest()
{
};
~CTest()
{
};
CTest& operator= ( CTest& v)
{
TestString = v.getTestString();
return *this;
};
QString getTestString
() { return TestString;
};
void setTestString
( QString value
) { TestString
= value ;
};
protected:
//
private:
//
};
//
class QDESIGNER_WIDGET_EXPORT EQtDataView
: public QWidget {
Q_OBJECT
//
Q_PROPERTY( QString ExportIdOffset READ getExportIdOffset WRITE setExportIdOffset
) //
Q_PROPERTY( QString ClearParamID READ getClearParamID WRITE setClearParamID
) //
Q_PROPERTY( QString DataSource0ID READ getDataSource0ID WRITE setDataSource0ID
) Q_PROPERTY( QString DataSource1ID READ getDataSource1ID WRITE setDataSource1ID
) Q_PROPERTY( QString DataSource2ID READ getDataSource2ID WRITE setDataSource2ID
) Q_PROPERTY( QString DataSource3ID READ getDataSource3ID WRITE setDataSource3ID
) //
Q_PROPERTY( QColor BackgroundColor READ getBackgroundColor WRITE setBackgroundColor
) Q_PROPERTY( QColor GridColor READ getGridColor WRITE setGridColor
) //
Q_ENUMS( ePlotMode )
Q_PROPERTY( ePlotMode PlotMode READ getPlotMode WRITE setPlotMode )
//
Q_PROPERTY( CTest MyTest READ getMyTest WRITE setMyTest )
public:
//
CTest MyTest;
CTest& getMyTest()
{
return MyTest;
};
void setMyTest( CTest& value )
{
MyTest = value;
};
//
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 !
Re: "has a relation" to work with designer ?
Did you write a designer plugin for it?
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 ?
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.
Re: "has a relation" to work with designer ?
you mean for the CTest class ?
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.