Build system changed to Cmake, ORM changed to QxORM, Qt6 compatibility.
This commit is contained in:
@@ -3,34 +3,35 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <odb/core.hxx>
|
||||
#include <data/comboitem.h>
|
||||
#include "../commodity_global.h"
|
||||
|
||||
#pragma db object
|
||||
class CommodityTypeData :public ComboItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
QX_REGISTER_FRIEND_CLASS(CommodityTypeData)
|
||||
Q_PROPERTY(QString name READ name WRITE setName)
|
||||
|
||||
public:
|
||||
CommodityTypeData(QObject *parent = 0);
|
||||
explicit CommodityTypeData(QObject *parent = nullptr);
|
||||
|
||||
int id() const;
|
||||
void setId(int id);
|
||||
long id() const;
|
||||
void setId(long id);
|
||||
|
||||
QString name() const;
|
||||
void setName(const QString &name);
|
||||
|
||||
private:
|
||||
friend class odb::access;
|
||||
#pragma db id auto
|
||||
int m_id;
|
||||
long m_id{0};
|
||||
QString m_name;
|
||||
|
||||
// ComboItem interface
|
||||
public:
|
||||
bool eq(ComboItem *other);
|
||||
QString toString();
|
||||
bool eq(ComboItem *other) override;
|
||||
QString toString() override;
|
||||
};
|
||||
|
||||
QX_REGISTER_HPP_COMM(CommodityTypeData, ComboItem, 0)
|
||||
|
||||
#endif // COMMODITYTYPEDATA_H
|
||||
|
||||
Reference in New Issue
Block a user