How to remove last step from QUndoStack
-
Hi and welcome
Im not sure you can.
For the push command
http://doc.qt.io/qt-5/qundostack.html#push
it says
"Once a command is pushed, the stack takes ownership of it. There are no getters to return the command, since modifying it after it has been executed will almost always lead to corruption of the document's state."So it dont sound like you cannot. I could be wrong. Did not work intensively with it.
-
-
Hi,
yeah that's when you really want to abort an action. I do it the following way:
- call undo()
- push an empty command to the undo stack (one that re-done does in fact nothing and has an empty string title)
- call undo() again
It's a mean trick, but it works :-)
-Michael. -
Hi,
yeah that's when you really want to abort an action. I do it the following way:
- call undo()
- push an empty command to the undo stack (one that re-done does in fact nothing and has an empty string title)
- call undo() again
It's a mean trick, but it works :-)
-Michael.