AutoTableModel now can display data from related table.
Usage example of ComboBox binding in Accommodation plugin.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
#include "acform.h"
|
||||
#include "ui_acform.h"
|
||||
#include <QList>
|
||||
|
||||
#include "accommodation-odb.hxx"
|
||||
|
||||
AcForm::AcForm(QWidget *parent) :
|
||||
AutoForm<Person>(parent),
|
||||
@@ -15,3 +18,14 @@ AcForm::~AcForm()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void AcForm::registerCombos()
|
||||
{
|
||||
QList<ComboData> cbData;
|
||||
Service<Address> srv;
|
||||
foreach (QSharedPointer<Address> adr, srv.all()) {
|
||||
cbData.append(ComboData(adr));
|
||||
}
|
||||
|
||||
registerBinding(ui->address, cbData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user