LB40
LB40

Reputation: 12331

Custom types as properties in QT Designer

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

Upvotes: 1

Views: 1474

Answers (1)

thuga
thuga

Reputation: 12901

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.

Upvotes: 2

Related Questions