You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
889 B
C++

#ifndef COMMODITYTYPEDATA_H
#define COMMODITYTYPEDATA_H
#include <QObject>
#include <QString>
#include <data/comboitem.h>
#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