简体   繁体   中英

QList as a property in qt designer custom widget

i have defined a custom widget, basically adding to QLabel. The simple (Qstring and enum ) properties are ok and appear in my QT designer.

I am now trying to add a property which is a list.

So I declare my property as :

 Q_PROPERTY(QList<int> points READ getpoints )

and I have my private variable QList<int> m_points;

Still, I cannot see my points property in QT designer propriety editor. And, I don't know what went wrong.

I've tried to add the DESIGNABLE flag but it does nothing.

Any clue ?

The problem stems from the fact I forgot the WRITE part in the property.

Adding the set method and the Write in the Q_PROPERTY did the trick.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM