Hi,
currently I am using 2 subclasses of QSortFilterProxyModel
Some of the data needs to be editable, some data not. So i made a QSortFilterProxyModelDisableEdit that does only remove the editable flag from a column.
On some tables I need an extra column that is not in the database. There for i used a ProxyModel described in this threat.
The objects are connected in the following way:
SqlProxyModelAddColumn* AddColumn = new SqlProxyModelAddColumn();
AddColumn->setSourceModel(DataTable);
SqlProxyModelDisalbeEdit* DisableEdit = new SqlProxyModelDisalbeEdit();
DisableEdit->setSourceModel(AddColumn);
QSqlTableModel* DataTable = new QSqlTableModel();
SqlProxyModelAddColumn* AddColumn = new SqlProxyModelAddColumn();
AddColumn->setSourceModel(DataTable);
SqlProxyModelDisalbeEdit* DisableEdit = new SqlProxyModelDisalbeEdit();
DisableEdit->setSourceModel(AddColumn);
To copy to clipboard, switch view to plain text mode
Noting is set in DisableEdit so it acts like a QSqlProxyModel,
AddColumn implementation is descriped in ProxyModel
When i try to edit some value for the DataTable all works fine.
but when i try to edit a value for the added column set data is never called. So i think there is something going wrong with the indexes, but i cant find the problem.
Any help is appreciated, thanks.
Bookmarks