Hello.

I'm adding undo stack to my app. But in the documentation I found:

voidQUndoStack::push(QUndoCommand <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 <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@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to