AutoTableModel now can display data from related table.
Usage example of ComboBox binding in Accommodation plugin.
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
#include "address.h"
|
||||
|
||||
#include <odb/core.hxx>
|
||||
|
||||
#pragma db object
|
||||
@@ -13,6 +15,7 @@ class Person : public QObject
|
||||
|
||||
Q_PROPERTY(QString firstName READ getFirstName WRITE setFirstName)
|
||||
Q_PROPERTY(QString lastName READ getLastName WRITE setLastName)
|
||||
Q_PROPERTY(QSharedPointer<QObject> address READ address WRITE setAddress)
|
||||
public:
|
||||
Person();
|
||||
|
||||
@@ -25,12 +28,16 @@ public:
|
||||
QString getLastName() const;
|
||||
void setLastName(const QString &value);
|
||||
|
||||
QSharedPointer<QObject> address() const;
|
||||
void setAddress(const QSharedPointer<QObject> &address);
|
||||
|
||||
private:
|
||||
friend class odb::access;
|
||||
#pragma db id auto
|
||||
int id;
|
||||
QString firstName;
|
||||
QString lastName;
|
||||
QSharedPointer<Address> m_address;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user