Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.7
-
None
Description
eg. {{ POD Infomation(QString name, QDate date) }} generate code as below
class Infomation { Q_GADGET Q_PROPERTY(QString name READ name WRITE setName) Q_PROPERTY(QDate date READ date WRITE setDate) public: Infomation() : m_name(), m_date() {} explicit Infomation(QString name, QDate date) : m_name(name), m_date(date) {} QString name() const { return m_name; } void setName(QString name) { if (name != m_name) { m_name = name; } } QDate date() const { return m_date; } void setDate(QDate date) { if (date != m_date) { m_date = date; } } private: QString m_name; QDate m_date; };
this should be a value type otherwise cannot used in QML
https://doc.qt.io/qt-6/qtqml-cppintegration-definetypes.html#registering-value-types