mercredi 29 août 2018

Qt cannot show property in designer

This is my class with the relevant code:

class TestClass: public QWidget {

    Q_OBJECT
    Q_PROPERTY(QColor color MEMBER m_color NOTIFY colorChanged)

public:
    public:
    explicit TestClass(QWidget *parent = nullptr): TestClass{parent} {};

private:
    QColor m_color;

signals:
    void colorChanged();
};

I am creating a plugin and I am able to get the dll file and load it with the designer. The problem is the following:

enter image description here

Where is the property? I'd expect here to have a TestClass header with the color property but it is not here. What am I missing?


I have Qt 5.11.1, the latest version of Qt Designer and I am using MinGW 5.3. I have created the entire project with File > New > Other projects > Custom Widget so it has the proper settings. The dll can be seen and loaded by the designer and it works well.

Aucun commentaire:

Enregistrer un commentaire