[Interest] QUndoStack

Alan Ezust alan.ezust at gmail.com
Fri Jun 24 17:42:34 CEST 2016


There is another thread on this very subject from last week:

http://lists.qt-project.org/pipermail/interest/2016-June/023114.html
http://lists.qt-project.org/pipermail/interest/2016-June/023116.html

I agree with you, the QUndoStack design is really odd and the need to
execute commands while pushing (in my view) makes it less flexible than it
could be. I wonder if we will hear from anyone who likes this design?



On Fri, Jun 24, 2016 at 5:22 AM, Igor Mironchik <igor.mironchik at gmail.com>
wrote:

> Hello.
>
> I'm adding undo stack to my app. But in the documentation I found:
>
> void QUndoStack::push(QUndoCommand <http://qundocommand.html> *cmd)
>
> Pushes cmd on the stack or merges it with the most recently executed
> command. In either case, executes cmd by calling its redo
> <http://qundostack.html#redo>() function.
> And in sources:
>
> void QUndoStack::push(QUndoCommand *cmd)
> {
>     Q_D(QUndoStack);
>     cmd->redo();
>
> So my question is why just pushed to the stack undo command executes? I.e.
> why cmd->redo() calls in push()?
>
> If I understand all correctly then cmd->redo() should be called only in
> QUndoStack::redo() method. And in push I just want to push new undo command
> to the stack...
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160624/b860565f/attachment.html>


More information about the Interest mailing list