Currently I want to update row items in a QStandardItemModel
without losing the sort order and row selection in the respective QTableView
.
I have tested two approaches:
- Clearing the model by
clear()
and re-adding the rows "destroys" everything including headers. - Removing and re-adding all rows keeps the headers, but still "destroys" selection and sort order.
I could try to manually to a) remove all rows no longer required and then b) update the items of the changed rows. But is there no easier way?