Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.2.1, 5.13.1
-
None
-
Linux
Description
I’m using QDataWidgetMapper to map a column from a QSortFilterProxyModel to a QComboBox.
QSqlRelationalTableModel *m_Model;
QSortFilterProxyModel *m_ProxyModel;
m_ProxyModel->setSourceModel(m_Model);mapper = new QDataWidgetMapper(this);
mapper->setModel(m_ProxyModel);QSqlTableModel *relModel = m_Model->relationModel(typeIndex);
projektComboBox->setModel(relModel);
projektComboBox->setModelColumn(relModel->fieldIndex("projectID");
mapper->addMapping(projektComboBox, typeIndex);
The values is displayed correctly in the ComboBox. But changes are not written to m_ProxyModel.
If I use the QSqlRelationalTableModel for mapping instead QSortFilterProxyModel for the mapping, everything works fine.
Another column mapped on a QLineEdit works fine with both: QSqlRelationalTableModel and QSortFilterProxyModel). Only QComboBox has the problem.
I upload a sample: "modelproblem.zip".
In the sample you can change the used model (QSqlRelationalTableModel/QSortFilterProxyModel) in line 23/24 in mainwindow.cpp