|
|
|
#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)
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit CommodityTypeData(QObject *parent = nullptr);
|
|
|
|
|
|
|
|
long id() const;
|
|
|
|
void setId(long id);
|
|
|
|
|
|
|
|
QString name() const;
|
|
|
|
void setName(const QString &name);
|
|
|
|
|
|
|
|
private:
|
|
|
|
long m_id{0};
|
|
|
|
QString m_name;
|
|
|
|
|
|
|
|
// ComboItem interface
|
|
|
|
public:
|
|
|
|
bool eq(ComboItem *other) override;
|
|
|
|
QString toString() override;
|
|
|
|
};
|
|
|
|
|
|
|
|
QX_REGISTER_HPP_COMM(CommodityTypeData, ComboItem, 0)
|
|
|
|
|
|
|
|
#endif // COMMODITYTYPEDATA_H
|