Implemented first page of camp wizard.

This commit is contained in:
2017-05-20 23:40:57 +02:00
parent 9c30d416e0
commit 6a042c46a1
13 changed files with 310 additions and 15 deletions
+11
View File
@@ -5,6 +5,7 @@ AddressItem::AddressItem(QObject *parent) : QObject(parent)
{
m_id = 0;
m_price = 0;
m_owner = false;
}
int AddressItem::id() const
@@ -86,3 +87,13 @@ void AddressItem::setAdbItem(const AddressbookDataPtr &adbItem)
{
m_adbItem = adbItem;
}
bool AddressItem::owner() const
{
return m_owner;
}
void AddressItem::setOwner(bool owner)
{
m_owner = owner;
}
+5
View File
@@ -20,6 +20,7 @@ class AddressItem : public QObject
Q_PROPERTY(QString lastName READ lastName WRITE setLastName)
Q_PROPERTY(QString address READ address WRITE setAddress)
Q_PROPERTY(QDecDouble price READ price WRITE setPrice)
Q_PROPERTY(bool owner READ owner WRITE setOwner)
public:
explicit AddressItem(QObject *parent = 0);
@@ -48,6 +49,9 @@ public:
AddressbookDataPtr adbItem() const;
void setAdbItem(const AddressbookDataPtr &adbItem);
bool owner() const;
void setOwner(bool owner);
private:
friend class odb::access;
#pragma db id auto
@@ -60,6 +64,7 @@ private:
#pragma db not_null
QWeakPointer<CampData> m_campData;
PersonPricePtr m_personPrice;
bool m_owner;
};
#endif // ADDRESSITEM_H
+10
View File
@@ -84,6 +84,11 @@ void CampData::addServiceItem(ServiceItemPtr serviceItem)
m_services.append(serviceItem);
}
void CampData::removeServiceItem(ServiceItemPtr serviceItem)
{
m_services.removeOne(serviceItem);
}
QOdbList<AddressItemPtr> CampData::people() const
{
return m_people;
@@ -99,6 +104,11 @@ void CampData::addPerson(AddressItemPtr person)
m_people.append(person);
}
void CampData::removePerson(AddressItemPtr person)
{
m_people.removeOne(person);
}
QDecDouble CampData::totalPrice() const
{
return TO_DEC(m_totalPrice);
+2
View File
@@ -48,10 +48,12 @@ public:
QOdbList<QSharedPointer<ServiceItem> > services() const;
void setServices(const QOdbList<QSharedPointer<ServiceItem> > &services);
void addServiceItem(ServiceItemPtr serviceItem);
void removeServiceItem(ServiceItemPtr serviceItem);
QOdbList<AddressItemPtr> people() const;
void setPeople(const QOdbList<AddressItemPtr> &people);
void addPerson(AddressItemPtr person);
void removePerson(AddressItemPtr person);
QDecDouble totalPrice() const;
void setTotalPrice(QDecDouble totalPrice);