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
1020 B
C
56 lines
1020 B
C
9 years ago
|
#ifndef ADDRESS_H
|
||
|
#define ADDRESS_H
|
||
|
|
||
|
#include <QObject>
|
||
|
#include <QString>
|
||
|
|
||
|
#include <data/comboitem.h>
|
||
|
|
||
|
#include <odb/core.hxx>
|
||
|
|
||
|
#pragma db object
|
||
|
class Address : public ComboItem
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
Q_PROPERTY(QString city READ city WRITE setCity)
|
||
|
Q_PROPERTY(QString street READ street WRITE setStreet)
|
||
|
Q_PROPERTY(QString houseNumber READ houseNumber WRITE setHouseNumber)
|
||
|
|
||
|
public:
|
||
|
explicit Address(QObject *parent = 0);
|
||
|
~Address();
|
||
|
|
||
|
QString city() const;
|
||
|
void setCity(const QString &city);
|
||
|
|
||
|
QString street() const;
|
||
|
void setStreet(const QString &street);
|
||
|
|
||
|
QString houseNumber() const;
|
||
|
void setHouseNumber(const QString &houseNumber);
|
||
|
|
||
|
int id() const;
|
||
|
void setId(int id);
|
||
|
|
||
|
private:
|
||
|
friend class odb::access;
|
||
|
|
||
|
#pragma db id auto
|
||
|
int m_id;
|
||
|
QString m_city;
|
||
|
QString m_street;
|
||
|
QString m_houseNumber;
|
||
|
|
||
|
signals:
|
||
|
|
||
|
public slots:
|
||
|
|
||
|
// ComboItem interface
|
||
|
public:
|
||
|
virtual bool eq(ComboItem *other);
|
||
|
virtual QString toString();
|
||
|
};
|
||
|
|
||
|
#endif // ADDRESS_H
|