Undo by saving the whole model-state not actions possible with QUndoStack?
Unsolved
General and Desktop
-
Hi,
i have a project where there is a QAbstractItemModel that can be manipulated by some actions.
The changes to the model sometimes are a bit complicated, so it is hard to keep track of all the action and the opposite of them.
Therefore I think the easiest way to implement Undo / Redo would be to just save the model state to a stack each time something is changed and load the old model for undo.The problem I see with this approach is, that for loading back the old model I also have to "undo" the beginInsertColumns() beginRemoveRows() begindeleteRows() and so on for the ItemView.
Is there maybe some example for such a case?