Details
-
Suggestion
-
Resolution: Unresolved
-
P4: Low
-
4.6.0
-
None
Description
As reported in 185538 and 174271 the Qt's Undo Framework doesnt support failing commands.
Here is the scenario:
Implement Undo/Redo for a database.
Imagine a Command called "InsertRow".
At the moment, if the redo() function of this command fails, there is no elegant way of supporting this. It still gets added to the UndoStack. A workaround is to have an internal flag in the command itself so that when the undo() is called for this command it will basically resolve into a NOP, but it's still in the stack.
One proper solution could be to let the void redo() function return a bool instead, and if this bool is false the UndoStack will not add it to the stack but actually delete it. (This would all happen in the push(...) function of the UndoStack).
Attachments
Issue Links
- replaces
-
QTBUG-1256 Extend the Undo/Redo framework to handle failing commands
-
- Closed
-