Build system changed to Cmake, ORM changed to QxORM, Qt6 compatibility.
This commit is contained in:
@@ -1,6 +1,26 @@
|
||||
#include "addressitem.h"
|
||||
#include <define.h>
|
||||
|
||||
QX_REGISTER_CPP_CAMP(AddressItem)
|
||||
|
||||
namespace qx {
|
||||
template<> void register_class(QxClass<AddressItem>& t) {
|
||||
t.setName("AddressItem");
|
||||
t.id(&AddressItem::m_id, "id");
|
||||
t.data(&AddressItem::m_firstName, "firstName");
|
||||
t.data(&AddressItem::m_lastName, "lastName");
|
||||
t.data(&AddressItem::m_address, "address");
|
||||
t.data(&AddressItem::m_price, "price");
|
||||
t.data(&AddressItem::m_owner, "owner");
|
||||
t.data(&AddressItem::m_sale, "sale");
|
||||
t.data(&AddressItem::m_totalPrice, "totalPrice");
|
||||
|
||||
t.relationManyToOne(&AddressItem::m_adbItem, "adbItem");
|
||||
t.relationManyToOne(&AddressItem::m_campData, "campData");
|
||||
t.relationManyToOne(&AddressItem::m_personPrice, "personPrice");
|
||||
}
|
||||
}
|
||||
|
||||
AddressItem::AddressItem(QObject *parent) : QObject(parent)
|
||||
{
|
||||
m_id = 0;
|
||||
@@ -10,12 +30,12 @@ AddressItem::AddressItem(QObject *parent) : QObject(parent)
|
||||
m_totalPrice = 0;
|
||||
}
|
||||
|
||||
int AddressItem::id() const
|
||||
long AddressItem::id() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
void AddressItem::setId(int id)
|
||||
void AddressItem::setId(long id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
@@ -60,12 +80,12 @@ void AddressItem::setPrice(QDecDouble price)
|
||||
m_price = FROM_DEC(price);
|
||||
}
|
||||
|
||||
QWeakPointer<CampData> AddressItem::campData() const
|
||||
QSharedPointer<CampData> AddressItem::campData() const
|
||||
{
|
||||
return m_campData;
|
||||
}
|
||||
|
||||
void AddressItem::setCampData(const QWeakPointer<CampData> &campData)
|
||||
void AddressItem::setCampData(const QSharedPointer<CampData> &campData)
|
||||
{
|
||||
m_campData = campData;
|
||||
}
|
||||
|
||||
+12
-12
@@ -6,16 +6,17 @@
|
||||
#include <QSharedPointer>
|
||||
#include <QWeakPointer>
|
||||
#include <QDecDouble.hh>
|
||||
#include <odb/core.hxx>
|
||||
#include <data/addressbookdata.h>
|
||||
|
||||
#include <addressbookdata.h>
|
||||
#include "../camp_global.h"
|
||||
|
||||
class CampData;
|
||||
|
||||
#pragma db object
|
||||
class AddressItem : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
QX_REGISTER_FRIEND_CLASS(AddressItem)
|
||||
Q_PROPERTY(QString firstName READ firstName WRITE setFirstName)
|
||||
Q_PROPERTY(QString lastName READ lastName WRITE setLastName)
|
||||
Q_PROPERTY(QString address READ address WRITE setAddress)
|
||||
@@ -27,8 +28,8 @@ class AddressItem : public QObject
|
||||
public:
|
||||
explicit AddressItem(QObject *parent = 0);
|
||||
|
||||
int id() const;
|
||||
void setId(int id);
|
||||
long id() const;
|
||||
void setId(long id);
|
||||
|
||||
QString firstName() const;
|
||||
void setFirstName(const QString &firstName);
|
||||
@@ -42,8 +43,8 @@ public:
|
||||
QDecDouble price() const;
|
||||
void setPrice(QDecDouble price);
|
||||
|
||||
QWeakPointer<CampData> campData() const;
|
||||
void setCampData(const QWeakPointer<CampData> &campData);
|
||||
QSharedPointer<CampData> campData() const;
|
||||
void setCampData(const QSharedPointer<CampData> &campData);
|
||||
|
||||
PersonPricePtr personPrice() const;
|
||||
void setPersonPrice(const PersonPricePtr &personPrice);
|
||||
@@ -61,9 +62,7 @@ public:
|
||||
void setSale(QDecDouble sale);
|
||||
|
||||
private:
|
||||
friend class odb::access;
|
||||
#pragma db id auto
|
||||
int m_id;
|
||||
long m_id;
|
||||
QString m_firstName;
|
||||
QString m_lastName;
|
||||
QString m_address;
|
||||
@@ -71,10 +70,11 @@ private:
|
||||
int m_price;
|
||||
int m_totalPrice;
|
||||
int m_sale;
|
||||
#pragma db not_null
|
||||
QWeakPointer<CampData> m_campData;
|
||||
CampDataPtr m_campData;
|
||||
PersonPricePtr m_personPrice;
|
||||
bool m_owner;
|
||||
};
|
||||
|
||||
QX_REGISTER_HPP_CAMP(AddressItem, QObject, 0)
|
||||
|
||||
#endif // ADDRESSITEM_H
|
||||
|
||||
+39
-10
@@ -1,6 +1,35 @@
|
||||
#include "campdata.h"
|
||||
#include <define.h>
|
||||
|
||||
QX_REGISTER_CPP_CAMP(CampData)
|
||||
|
||||
namespace qx {
|
||||
template<> void register_class(QxClass<CampData>& t) {
|
||||
t.setName("CampData");
|
||||
t.id(&CampData::m_id, "id");
|
||||
t.data(&CampData::m_numSer, "numSer");
|
||||
t.data(&CampData::m_start, "start");
|
||||
t.data(&CampData::m_end, "end");
|
||||
t.data(&CampData::m_ownerFirstame, "ownerFirstame");
|
||||
t.data(&CampData::m_ownerLastname, "ownerLastname");
|
||||
t.data(&CampData::m_ownerAddress, "ownerAddress");
|
||||
t.data(&CampData::m_totalPrice, "totalPrice");
|
||||
t.data(&CampData::m_sale, "sale");
|
||||
t.data(&CampData::m_fixedSale, "fixedSale");
|
||||
t.data(&CampData::m_fullPrice, "fullPrice");
|
||||
t.data(&CampData::m_totalSale, "totalSale");
|
||||
t.data(&CampData::m_onVoucher, "onVoucher");
|
||||
t.data(&CampData::m_createdBy, "createdBy");
|
||||
t.data(&CampData::m_created, "created");
|
||||
t.data(&CampData::m_updatedBy, "updatedBy");
|
||||
t.data(&CampData::m_updated, "updated");
|
||||
|
||||
t.relationManyToOne(&CampData::m_season, "season");
|
||||
t.relationOneToMany(&CampData::m_people, "people", "campData");
|
||||
t.relationOneToMany(&CampData::m_services, "services", "campData");
|
||||
}
|
||||
}
|
||||
|
||||
CampData::CampData(QObject *parent) : QObject(parent)
|
||||
{
|
||||
m_id = 0;
|
||||
@@ -12,12 +41,12 @@ CampData::CampData(QObject *parent) : QObject(parent)
|
||||
m_onVoucher = false;
|
||||
}
|
||||
|
||||
int CampData::id() const
|
||||
long CampData::id() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
void CampData::setId(int id)
|
||||
void CampData::setId(long id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
@@ -72,42 +101,42 @@ void CampData::setOwnerAddress(const QString &ownerAddress)
|
||||
m_ownerAddress = ownerAddress;
|
||||
}
|
||||
|
||||
QOdbList<ServiceItemPtr> CampData::services() const
|
||||
QList<ServiceItemPtr> CampData::services() const
|
||||
{
|
||||
return m_services;
|
||||
}
|
||||
|
||||
void CampData::setServices(const QOdbList<QSharedPointer<ServiceItem> > &services)
|
||||
void CampData::setServices(const QList<QSharedPointer<ServiceItem> > &services)
|
||||
{
|
||||
m_services = services;
|
||||
}
|
||||
|
||||
void CampData::addServiceItem(ServiceItemPtr serviceItem)
|
||||
void CampData::addServiceItem(const ServiceItemPtr& serviceItem)
|
||||
{
|
||||
m_services.append(serviceItem);
|
||||
}
|
||||
|
||||
void CampData::removeServiceItem(ServiceItemPtr serviceItem)
|
||||
void CampData::removeServiceItem(const ServiceItemPtr& serviceItem)
|
||||
{
|
||||
m_services.removeOne(serviceItem);
|
||||
}
|
||||
|
||||
QOdbList<AddressItemPtr> CampData::people() const
|
||||
QList<AddressItemPtr> CampData::people() const
|
||||
{
|
||||
return m_people;
|
||||
}
|
||||
|
||||
void CampData::setPeople(const QOdbList<AddressItemPtr> &people)
|
||||
void CampData::setPeople(const QList<AddressItemPtr> &people)
|
||||
{
|
||||
m_people = people;
|
||||
}
|
||||
|
||||
void CampData::addPerson(AddressItemPtr person)
|
||||
void CampData::addPerson(const AddressItemPtr& person)
|
||||
{
|
||||
m_people.append(person);
|
||||
}
|
||||
|
||||
void CampData::removePerson(AddressItemPtr person)
|
||||
void CampData::removePerson(const AddressItemPtr& person)
|
||||
{
|
||||
m_people.removeOne(person);
|
||||
}
|
||||
|
||||
+20
-22
@@ -5,15 +5,15 @@
|
||||
#include <QObject>
|
||||
#include <QDate>
|
||||
#include <QDecDouble.hh>
|
||||
#include <odb/core.hxx>
|
||||
#include <odb/qt/list.hxx>
|
||||
|
||||
#include <data/season.h>
|
||||
|
||||
#pragma db object
|
||||
#include "../camp_global.h"
|
||||
|
||||
class CampData : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
QX_REGISTER_FRIEND_CLASS(CampData)
|
||||
Q_PROPERTY(QString numSer READ numSer WRITE setNumSer)
|
||||
Q_PROPERTY(QDate start READ start WRITE setStart)
|
||||
Q_PROPERTY(QDate end READ end WRITE setEnd)
|
||||
@@ -31,10 +31,10 @@ class CampData : public QObject
|
||||
Q_PROPERTY(QDateTime updated READ updated WRITE setUpdated)
|
||||
|
||||
public:
|
||||
explicit CampData(QObject *parent = 0);
|
||||
explicit CampData(QObject *parent = nullptr);
|
||||
|
||||
int id() const;
|
||||
void setId(int id);
|
||||
long id() const;
|
||||
void setId(long id);
|
||||
|
||||
QDate start() const;
|
||||
void setStart(const QDate &start);
|
||||
@@ -51,15 +51,15 @@ public:
|
||||
QString ownerAddress() const;
|
||||
void setOwnerAddress(const QString &ownerAddress);
|
||||
|
||||
QOdbList<QSharedPointer<ServiceItem> > services() const;
|
||||
void setServices(const QOdbList<QSharedPointer<ServiceItem> > &services);
|
||||
void addServiceItem(ServiceItemPtr serviceItem);
|
||||
void removeServiceItem(ServiceItemPtr serviceItem);
|
||||
QList<ServiceItemPtr> services() const;
|
||||
void setServices(const QList<ServiceItemPtr> &services);
|
||||
void addServiceItem(const ServiceItemPtr& serviceItem);
|
||||
void removeServiceItem(const ServiceItemPtr& serviceItem);
|
||||
|
||||
QOdbList<AddressItemPtr> people() const;
|
||||
void setPeople(const QOdbList<AddressItemPtr> &people);
|
||||
void addPerson(AddressItemPtr person);
|
||||
void removePerson(AddressItemPtr person);
|
||||
QList<AddressItemPtr> people() const;
|
||||
void setPeople(const QList<AddressItemPtr> &people);
|
||||
void addPerson(const AddressItemPtr& person);
|
||||
void removePerson(const AddressItemPtr& person);
|
||||
|
||||
QDecDouble totalPrice() const;
|
||||
void setTotalPrice(QDecDouble totalPrice);
|
||||
@@ -98,19 +98,15 @@ public:
|
||||
void setUpdated(const QDateTime &updated);
|
||||
|
||||
private:
|
||||
friend class odb::access;
|
||||
#pragma db id auto
|
||||
int m_id;
|
||||
long m_id;
|
||||
QString m_numSer;
|
||||
QDate m_start;
|
||||
QDate m_end;
|
||||
QString m_ownerFirstame;
|
||||
QString m_ownerLastname;
|
||||
QString m_ownerAddress;
|
||||
#pragma db value_not_null inverse(m_campData)
|
||||
QOdbList<ServiceItemPtr> m_services;
|
||||
#pragma db value_not_null inverse(m_campData)
|
||||
QOdbList<AddressItemPtr> m_people;
|
||||
QList<ServiceItemPtr> m_services;
|
||||
QList<AddressItemPtr> m_people;
|
||||
int m_fullPrice;
|
||||
int m_totalPrice;
|
||||
int m_sale;
|
||||
@@ -124,4 +120,6 @@ private:
|
||||
QDateTime m_updated;
|
||||
};
|
||||
|
||||
QX_REGISTER_HPP_CAMP(CampData, QObject, 0)
|
||||
|
||||
#endif // CAMPDATA_H
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
#include "personprice.h"
|
||||
#include <define.h>
|
||||
|
||||
QX_REGISTER_CPP_CAMP(PersonPrice)
|
||||
|
||||
namespace qx {
|
||||
template<> void register_class(QxClass<PersonPrice>& t) {
|
||||
t.setName("PersonPrice");
|
||||
t.id(&PersonPrice::m_id, "id");
|
||||
t.data(&PersonPrice::m_description, "description");
|
||||
t.data(&PersonPrice::m_fromAge, "fromAge");
|
||||
t.data(&PersonPrice::m_toAge, "toAge");
|
||||
t.data(&PersonPrice::m_price, "price");
|
||||
t.data(&PersonPrice::m_active, "active");
|
||||
}
|
||||
}
|
||||
|
||||
PersonPrice::PersonPrice(QObject *parent) : QObject(parent)
|
||||
{
|
||||
m_id = 0;
|
||||
@@ -10,12 +24,12 @@ PersonPrice::PersonPrice(QObject *parent) : QObject(parent)
|
||||
m_active = true;
|
||||
}
|
||||
|
||||
int PersonPrice::id() const
|
||||
long PersonPrice::id() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
void PersonPrice::setId(int id)
|
||||
void PersonPrice::setId(long id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
@@ -3,12 +3,14 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QDecDouble.hh>
|
||||
#include <odb/core.hxx>
|
||||
|
||||
#pragma db object
|
||||
#include "../camp_global.h"
|
||||
|
||||
class PersonPrice : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
QX_REGISTER_FRIEND_CLASS(PersonPrice)
|
||||
Q_PROPERTY(QString description READ description WRITE setDescription)
|
||||
Q_PROPERTY(int fromAge READ fromAge WRITE setFromAge)
|
||||
Q_PROPERTY(int toAge READ toAge WRITE setToAge)
|
||||
@@ -18,8 +20,8 @@ class PersonPrice : public QObject
|
||||
public:
|
||||
explicit PersonPrice(QObject *parent = 0);
|
||||
|
||||
int id() const;
|
||||
void setId(int id);
|
||||
long id() const;
|
||||
void setId(long id);
|
||||
|
||||
QString description() const;
|
||||
void setDescription(const QString &description);
|
||||
@@ -37,9 +39,7 @@ public:
|
||||
void setActive(bool active);
|
||||
|
||||
private:
|
||||
friend class odb::access;
|
||||
#pragma db id auto
|
||||
int m_id;
|
||||
long m_id;
|
||||
QString m_description;
|
||||
int m_fromAge;
|
||||
int m_toAge;
|
||||
@@ -47,4 +47,6 @@ private:
|
||||
bool m_active;
|
||||
};
|
||||
|
||||
QX_REGISTER_HPP_CAMP(PersonPrice, QObject, 0)
|
||||
|
||||
#endif // PERSONPRICE_H
|
||||
|
||||
+14
-2
@@ -1,6 +1,18 @@
|
||||
#include "sale.h"
|
||||
#include <define.h>
|
||||
|
||||
QX_REGISTER_CPP_CAMP(Sale)
|
||||
|
||||
namespace qx {
|
||||
template<> void register_class(QxClass<Sale>& t) {
|
||||
t.setName("Sale");
|
||||
t.id(&Sale::m_id, "id");
|
||||
t.data(&Sale::m_sale, "sale");
|
||||
t.data(&Sale::m_fixed, "fixed");
|
||||
t.data(&Sale::m_description, "description");
|
||||
}
|
||||
}
|
||||
|
||||
Sale::Sale(QObject *parent) : ComboItem(parent)
|
||||
{
|
||||
m_id = 0;
|
||||
@@ -8,12 +20,12 @@ Sale::Sale(QObject *parent) : ComboItem(parent)
|
||||
m_fixed = false;
|
||||
}
|
||||
|
||||
int Sale::id() const
|
||||
long Sale::id() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
void Sale::setId(int id)
|
||||
void Sale::setId(long id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
+12
-10
@@ -2,23 +2,25 @@
|
||||
#define SALE_H
|
||||
|
||||
#include <QObject>
|
||||
#include <odb/core.hxx>
|
||||
#include <QDecDouble.hh>
|
||||
#include <combodata.h>
|
||||
|
||||
#pragma db object
|
||||
#include "../camp_global.h"
|
||||
|
||||
class Sale : public ComboItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
QX_REGISTER_FRIEND_CLASS(Sale)
|
||||
Q_PROPERTY(QString description READ description WRITE setDescription)
|
||||
Q_PROPERTY(QDecDouble sale READ sale WRITE setSale)
|
||||
Q_PROPERTY(bool fixed READ fixed WRITE setFixed)
|
||||
|
||||
public:
|
||||
explicit Sale(QObject *parent = 0);
|
||||
explicit Sale(QObject *parent = nullptr);
|
||||
|
||||
int id() const;
|
||||
void setId(int id);
|
||||
long id() const;
|
||||
void setId(long id);
|
||||
|
||||
QDecDouble sale() const;
|
||||
void setSale(QDecDouble sale);
|
||||
@@ -30,17 +32,17 @@ public:
|
||||
void setDescription(const QString &description);
|
||||
|
||||
private:
|
||||
friend class odb::access;
|
||||
#pragma db id auto
|
||||
int m_id;
|
||||
long m_id;
|
||||
QString m_description;
|
||||
int m_sale;
|
||||
bool m_fixed;
|
||||
|
||||
// ComboItem interface
|
||||
public:
|
||||
bool eq(ComboItem *other);
|
||||
QString toString();
|
||||
bool eq(ComboItem *other) override;
|
||||
QString toString() override;
|
||||
};
|
||||
|
||||
QX_REGISTER_HPP_CAMP(Sale, ComboItem, 0)
|
||||
|
||||
#endif // SALE_H
|
||||
|
||||
@@ -1,6 +1,26 @@
|
||||
#include "serviceitem.h"
|
||||
#include <define.h>
|
||||
|
||||
QX_REGISTER_CPP_CAMP(ServiceItem)
|
||||
|
||||
namespace qx {
|
||||
template<> void register_class(QxClass<ServiceItem>& t) {
|
||||
t.setName("ServiceItem");
|
||||
t.id(&ServiceItem::m_id, "id");
|
||||
t.data(&ServiceItem::m_name, "name");
|
||||
t.data(&ServiceItem::m_code, "code");
|
||||
t.data(&ServiceItem::m_price, "price");
|
||||
t.data(&ServiceItem::m_salePossible, "salePossible");
|
||||
t.data(&ServiceItem::m_type, "type");
|
||||
t.data(&ServiceItem::m_sale, "sale");
|
||||
t.data(&ServiceItem::m_description, "description");
|
||||
t.data(&ServiceItem::m_totalPrice, "totalPrice");
|
||||
t.data(&ServiceItem::m_fullPrice, "fullPrice");
|
||||
|
||||
t.relationManyToOne(&ServiceItem::m_campData, "campData");
|
||||
}
|
||||
}
|
||||
|
||||
ServiceItem::ServiceItem(QObject *parent) : QObject(parent)
|
||||
{
|
||||
m_id = 0;
|
||||
@@ -8,15 +28,16 @@ ServiceItem::ServiceItem(QObject *parent) : QObject(parent)
|
||||
m_sale = 0;
|
||||
m_price = 0;
|
||||
m_totalPrice = 0;
|
||||
m_fullPrice = 0;
|
||||
m_type = AccService::OTHER;
|
||||
}
|
||||
|
||||
int ServiceItem::id() const
|
||||
long ServiceItem::id() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
void ServiceItem::setId(int id)
|
||||
void ServiceItem::setId(long id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
+11
-11
@@ -6,16 +6,17 @@
|
||||
#include <QSharedPointer>
|
||||
#include <QWeakPointer>
|
||||
#include <QDecDouble.hh>
|
||||
#include <data/accservice.h>
|
||||
|
||||
#include <odb/core.hxx>
|
||||
#include <accservice.h>
|
||||
#include "../camp_global.h"
|
||||
|
||||
class CampData;
|
||||
|
||||
#pragma db object
|
||||
class ServiceItem : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
QX_REGISTER_FRIEND_CLASS(ServiceItem)
|
||||
Q_PROPERTY(QString name READ name WRITE setName)
|
||||
Q_PROPERTY(QString code READ code WRITE setCode)
|
||||
Q_PROPERTY(QString description READ description WRITE setDescription)
|
||||
@@ -27,10 +28,10 @@ class ServiceItem : public QObject
|
||||
Q_ENUMS(AccService::ServiceType)
|
||||
|
||||
public:
|
||||
explicit ServiceItem(QObject *parent = 0);
|
||||
explicit ServiceItem(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);
|
||||
@@ -63,9 +64,7 @@ public:
|
||||
void setFullPrice(QDecDouble fullPrice);
|
||||
|
||||
private:
|
||||
friend class odb::access;
|
||||
#pragma db id auto
|
||||
int m_id;
|
||||
long m_id;
|
||||
QString m_name;
|
||||
QString m_code;
|
||||
QString m_description;
|
||||
@@ -75,8 +74,9 @@ private:
|
||||
int m_sale;
|
||||
bool m_salePossible;
|
||||
AccService::ServiceType m_type;
|
||||
#pragma db not_null
|
||||
QWeakPointer<CampData> m_campData;
|
||||
CampDataPtr m_campData;
|
||||
};
|
||||
|
||||
QX_REGISTER_HPP_CAMP(ServiceItem, QObject, 0)
|
||||
|
||||
#endif // SREVICEITEM_H
|
||||
|
||||
Reference in New Issue
Block a user