ZikO
17th September 2012, 12:56
Hi,
I need someone's advice.
I need to store somewhere a set of items, objects of QStandardItem, that are in a model, a QStandardItemModel. I need to store both items and their coordinates in a model. Essentially, in my application, a user can choose a few rows from a QTableView and make changes to a model. I synced a form and a Viewer with the same model so all changes should be updated immediately in the Viewer--QTableView.
However, I would like to have a functionality that all changes can be cancelled. Therefore, I would need to store somewhere original content of those records that have been changed. I could make a copy of the whole model and operate on its copy but this would not be very memory efficient. I thought I could utilize any of the Qt containers but I am not expert and I really don't know which container or even combination to choose. I would basically need to store a content of a particular item along with its coordinates. I would need something like this:
Container<QtStandardItem, QModelIndex>
The only problem is I don't know which container would be best for it or perhaps I'd better made my own class.
I hope I've been clear with the explanation.
I need someone's advice.
I need to store somewhere a set of items, objects of QStandardItem, that are in a model, a QStandardItemModel. I need to store both items and their coordinates in a model. Essentially, in my application, a user can choose a few rows from a QTableView and make changes to a model. I synced a form and a Viewer with the same model so all changes should be updated immediately in the Viewer--QTableView.
However, I would like to have a functionality that all changes can be cancelled. Therefore, I would need to store somewhere original content of those records that have been changed. I could make a copy of the whole model and operate on its copy but this would not be very memory efficient. I thought I could utilize any of the Qt containers but I am not expert and I really don't know which container or even combination to choose. I would basically need to store a content of a particular item along with its coordinates. I would need something like this:
Container<QtStandardItem, QModelIndex>
The only problem is I don't know which container would be best for it or perhaps I'd better made my own class.
I hope I've been clear with the explanation.