Details
-
Task
-
Resolution: Fixed
-
P2: Important
-
None
Description
Let's say we have next data objects in c++:
struct Payment { Q_GADGET Q_PROPERTY(Type type MEMBER type) Q_PROPERTY(qint64 amount MEMBER amount) Q_PROPERTY(QString name MEMBER name) public: enum class Type { Cash, TransportCard, BankCard }; Q_ENUM(Type) Type type = Type::Cash; qint64 amount; QString name; }; struct Fare { Q_GADGET Q_PROPERTY(Type type MEMBER type) Q_PROPERTY(QVector<Payment> paymentOptions MEMBER paymentOptions)public: enum class Type { Unkonwn = -1, Fixed, MultiFixed, ZoneBased, }; Q_ENUM(Type); Type type; QVector<Payment> paymentOptions; }
Idea is to use ContainerT<Q_GADGET class> in QML without model or explicitly convert it to QVariantList.
Attachments
Issue Links
- is required for
-
QTBUG-79330 Improve handling of Q_GADGETs in QML
- Open
- relates to
-
QTBUG-71574 Provide a better way to register sequential and associative types for usage in QML
- Closed
-
QTBUG-72223 Make it possible to declare Q_GADGET instances in QML
- Open
-
QTBUG-56484 Definition of gadgets in QML
- Open
-
QTBUG-54983 Create Q_GADGET objects in QML
- Closed