Question

I am developing a custom widget to QT Designer.

Everything works fine for basic QT types and list, but I have a problem when defining a property of a custom type.

Here is the declaration of the property :

    Q_PROPERTY(Courbe* courbes READ getcourbe WRITE setcourbe1 DESIGNABLE true)

public:
    TestCourbe(QWidget *parent = 0);

    Courbe* TestCourbe::getcourbe() const ;
    void TestCourbe::setcourbe1(Courbe *n);

Here is the beginning of the definition of my Courbe class :

class Courbe : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QString valeursX READ readvaleurX WRITE setvaleurX)
    Q_PROPERTY(QString valeursY READ readvaleurY WRITE setvaleurY)
    Q_PROPERTY(QString legende READ readlegende WRITE setlegende)

The problem is the Courbe property is not displayed in QT Designer. Should I add something to the Courbe declaration ? (I've seen the Q_DECLARE_METATYPE macro but this is for QML only right ?)

thanks

Was it helpful?

Solution

It seems it is not possible to show custom type properties in the designer.

The reason for this is explained in this thread. Basically the designer doesn't know what editor to use for custom type properties.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top