#ifndef COMMODITYTYPEDATA_H #define COMMODITYTYPEDATA_H #include #include #include #include "../commodity_global.h" class CommodityTypeData :public ComboItem { Q_OBJECT QX_REGISTER_FRIEND_CLASS(CommodityTypeData) Q_PROPERTY(QString name READ name WRITE setName) Q_PROPERTY(QString color READ color WRITE setColor) public: explicit CommodityTypeData(QObject *parent = nullptr); long id() const; void setId(long id); QString name() const; void setName(const QString &name); QString color() const; void setColor(const QString& color); private: long m_id{0}; QString m_name; QString m_color; // ComboItem interface public: bool eq(ComboItem *other) override; QString toString() override; }; QX_REGISTER_HPP_COMM(CommodityTypeData, ComboItem, 0) #endif // COMMODITYTYPEDATA_H