Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.9.4
-
None
Description
The docs for QUndoStack::undo says:
After the command is undone, if QUundoCommand::isObsolete() returns true, then the command will be deleted from the stack.
But that doesn't line up with the source code:
if (!cmd->isObsolete())
cmd->undo()
which means that the command is not undone at all if it's obsolete.
It's useful to be able to undo and delete a command in one step. One example use case for this is when you're creating a macro and something goes wrong in the middle.