pascal123
23rd February 2010, 20:12
Hi all,
I am experiencing a problem with proxy models, and would greatly appreciate any help. I am not sure if I somehow missed part of the underlying concepts:
What works:
I have a QAbstractTableModel-derived model that is displayed in a QTableView.
This works. I can update the model by calling beginInsertRows(), doing the changes, and then calling endInsertRows(). The view is updated as expected.
What works with the "proxy part":
The same data is displayed, through a QAbstractProxyModel, in another QTableView.
The re-mapping of indexes and selections is implemented and data is displayed correctly.
What does not work:
The view linked to the data via the proxy model is not updated if I change/add data to the model.
The re-mapping of model indexes is relatively complex, and it is not trivial to determine which table fields will change in the "proxy view" when the original model is changed. Therefore, it would be great just to tell the view/proxy model to re-read all (visible) table fields, and to display more/less rows/columns if necessary. However, I unfortunately could not figure out how to do that.
Do I miss an important underlying concept here?
Thanks for your help
Pascal
I am experiencing a problem with proxy models, and would greatly appreciate any help. I am not sure if I somehow missed part of the underlying concepts:
What works:
I have a QAbstractTableModel-derived model that is displayed in a QTableView.
This works. I can update the model by calling beginInsertRows(), doing the changes, and then calling endInsertRows(). The view is updated as expected.
What works with the "proxy part":
The same data is displayed, through a QAbstractProxyModel, in another QTableView.
The re-mapping of indexes and selections is implemented and data is displayed correctly.
What does not work:
The view linked to the data via the proxy model is not updated if I change/add data to the model.
The re-mapping of model indexes is relatively complex, and it is not trivial to determine which table fields will change in the "proxy view" when the original model is changed. Therefore, it would be great just to tell the view/proxy model to re-read all (visible) table fields, and to display more/less rows/columns if necessary. However, I unfortunately could not figure out how to do that.
Do I miss an important underlying concept here?
Thanks for your help
Pascal