AutoTableModel now can display data from related table.
Usage example of ComboBox binding in Accommodation plugin.
This commit is contained in:
@@ -60,6 +60,7 @@ public:
|
||||
protected:
|
||||
virtual void bindOtherToUi() {}
|
||||
virtual bool bindOtherToData() { return true; }
|
||||
virtual void registerCombos() {}
|
||||
|
||||
private:
|
||||
QSharedPointer<T> m_entity;
|
||||
@@ -69,6 +70,7 @@ private:
|
||||
bool m_newRec;
|
||||
|
||||
void bindToUi() {
|
||||
registerCombos();
|
||||
foreach (QWidget *widget, m_bindWidgets) {
|
||||
const char* prop = widget->metaObject()->userProperty().name();
|
||||
widget->setProperty(prop, ((QObject*)m_entity.data())->property(widget->objectName().toStdString().c_str()));
|
||||
|
||||
Reference in New Issue
Block a user