Build system changed to Cmake, ORM changed to QxORM, Qt6 compatibility.

This commit is contained in:
2023-04-28 22:25:29 +02:00
parent 30e6180c82
commit d699ce79f7
481 changed files with 2310 additions and 130206 deletions
+11 -18
View File
@@ -4,27 +4,21 @@
#include <QObject>
#include <QString>
#include <QDecDouble.hh>
#include <odb/core.hxx>
#include <QSharedPointer>
#include <QDateTime>
#include <enums.h>
#include "../shop_global.h"
#include <QtCore/qglobal.h>
#if defined(SHOP_LIBRARY)
# define SHOPSHARED_EXPORT Q_DECL_EXPORT
#else
# define SHOPSHARED_EXPORT Q_DECL_IMPORT
#endif
class Voucher;
#pragma db object
class SHOPSHARED_EXPORT VoucherItem : public QObject
{
Q_OBJECT
QX_REGISTER_FRIEND_CLASS(VoucherItem)
Q_PROPERTY(QDateTime insertDate READ insertDate WRITE setInsertDate)
Q_PROPERTY(QString name READ name WRITE setName)
Q_PROPERTY(int count READ count WRITE setCount NOTIFY countChanged)
@@ -35,10 +29,10 @@ class SHOPSHARED_EXPORT VoucherItem : public QObject
Q_PROPERTY(QDecDouble price READ price WRITE setPrice)
public:
explicit VoucherItem(QObject *parent = 0);
explicit VoucherItem(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);
@@ -69,8 +63,8 @@ public:
QDecDouble vatAmount() const;
QWeakPointer<Voucher> voucher() const;
void setVoucher(const QWeakPointer<Voucher> &voucher);
QSharedPointer<Voucher> voucher() const;
void setVoucher(const QSharedPointer<Voucher> &voucher);
QDateTime insertDate() const;
void setInsertDate(const QDateTime &insertDate);
@@ -79,9 +73,7 @@ signals:
void countChanged(int oldCount);
private:
friend class odb::access;
#pragma db id auto
int m_id;
long m_id;
QString m_name;
int m_count;
int m_unitPrice;
@@ -92,10 +84,11 @@ private:
QDateTime m_insertDate;
QString m_itemPlugin;
Enums::VatType m_vatType;
#pragma db not_null
QWeakPointer<Voucher> m_voucher;
QSharedPointer<Voucher> m_voucher;
};
typedef QSharedPointer<VoucherItem> VoucherItemPtr;
QX_REGISTER_HPP_SHOP(VoucherItem, QObject, 0);
#endif // VOUCHERITEM_H