You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.3 KiB
C
56 lines
1.3 KiB
C
8 years ago
|
#ifndef ADDRESSITEM_H
|
||
|
#define ADDRESSITEM_H
|
||
|
|
||
|
#include "camp-data.h"
|
||
|
#include <QObject>
|
||
|
#include <QSharedPointer>
|
||
|
#include <QWeakPointer>
|
||
|
#include <QDecDouble.hh>
|
||
|
#include <odb/core.hxx>
|
||
|
|
||
|
class CampData;
|
||
|
|
||
|
#pragma db object
|
||
|
class AddressItem : public QObject
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
Q_PROPERTY(QString firstName READ firstName WRITE setFirstName)
|
||
|
Q_PROPERTY(QString lastName READ lastName WRITE setLastName)
|
||
|
Q_PROPERTY(QString address READ address WRITE setAddress)
|
||
|
Q_PROPERTY(QDecDouble price READ price WRITE setPrice)
|
||
|
|
||
|
public:
|
||
|
explicit AddressItem(QObject *parent = 0);
|
||
|
|
||
|
int id() const;
|
||
|
void setId(int id);
|
||
|
|
||
|
QString firstName() const;
|
||
|
void setFirstName(const QString &firstName);
|
||
|
|
||
|
QString lastName() const;
|
||
|
void setLastName(const QString &lastName);
|
||
|
|
||
|
QString address() const;
|
||
|
void setAddress(const QString &address);
|
||
|
|
||
|
QDecDouble price() const;
|
||
|
void setPrice(QDecDouble price);
|
||
|
|
||
|
QWeakPointer<CampData> campData() const;
|
||
|
void setCampData(const QWeakPointer<CampData> &campData);
|
||
|
|
||
|
private:
|
||
|
friend class odb::access;
|
||
|
#pragma db id auto
|
||
|
int m_id;
|
||
|
QString m_firstName;
|
||
|
QString m_lastName;
|
||
|
QString m_address;
|
||
|
int m_price;
|
||
|
#pragma db not_null
|
||
|
QWeakPointer<CampData> m_campData;
|
||
|
};
|
||
|
|
||
|
#endif // ADDRESSITEM_H
|