AutoTableModel now can display data from related table.

Usage example of ComboBox binding in Accommodation plugin.
This commit is contained in:
2016-02-12 15:58:12 +01:00
parent 1b6141923f
commit 7ea06881ef
12 changed files with 187 additions and 4 deletions
+2
View File
@@ -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()));