Build system changed to Cmake, ORM changed to QxORM, Qt6 compatibility.
This commit is contained in:
@@ -3,17 +3,20 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <odb/core.hxx>
|
||||
#include "commoditytypedata.h"
|
||||
#include <shopitem.h>
|
||||
#include <QDecDouble.hh>
|
||||
#include <QSharedDataPointer>
|
||||
#include <enums.h>
|
||||
|
||||
#include "../commodity_global.h"
|
||||
|
||||
#pragma db object
|
||||
class CommodityData : public ShopItem
|
||||
class CommodityData : public IShopItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
QX_REGISTER_FRIEND_CLASS(CommodityData)
|
||||
Q_PROPERTY(QString code READ code WRITE setCode)
|
||||
Q_PROPERTY(QString name READ name WRITE setName)
|
||||
Q_PROPERTY(QString shortName READ shortName WRITE setShortName)
|
||||
@@ -23,10 +26,10 @@ class CommodityData : public ShopItem
|
||||
Q_PROPERTY(int count READ count WRITE setCount)
|
||||
|
||||
public:
|
||||
CommodityData(QObject *parent = 0);
|
||||
explicit CommodityData(QObject *parent = nullptr);
|
||||
|
||||
int id() override;
|
||||
void setId(int id);
|
||||
long id() override;
|
||||
void setId(long id);
|
||||
|
||||
QString name() override;
|
||||
void setName(const QString &name);
|
||||
@@ -49,10 +52,10 @@ public:
|
||||
int count() const;
|
||||
void setCount(int count);
|
||||
|
||||
Q_INVOKABLE QStringList eagerLoad();
|
||||
|
||||
private:
|
||||
friend class odb::access;
|
||||
#pragma db id auto
|
||||
int m_id;
|
||||
long m_id{0};
|
||||
QString m_name;
|
||||
QString m_shortName;
|
||||
QString m_code;
|
||||
@@ -66,8 +69,11 @@ public:
|
||||
QDecDouble unitPrice() override;
|
||||
Enums::VatType vatType() override;
|
||||
QString pluginId() override;
|
||||
|
||||
};
|
||||
|
||||
typedef QSharedPointer<CommodityData> CommodityDataPtr;
|
||||
|
||||
QX_REGISTER_HPP_COMM(CommodityData, IShopItem, 0)
|
||||
|
||||
#endif // COMMODITYDATA_H
|
||||
|
||||
Reference in New Issue
Block a user