[Interest] QUndoStack

Mike Jackson imikejackson at gmail.com
Fri Jun 17 19:56:29 CEST 2016


Yes, we have already executed what constitutes the command by the time 
we push it onto the stack. Maybe we are not using QUndoStack correctly 
then? we should be creating the command that _should_ get executed, 
place it on the stack, which will then execute the command.

Still seems odd but we can look at doing that.
-- 
Mike Jackson  [mike.jackson at bluequartz.net]


Elvis Stansvik wrote:
> 2016-06-17 18:18 GMT+02:00 Mike Jackson<imikejackson at gmail.com>:
>> We are using the QUndoStack and when we "push()" onto the stack the actual
>> QUndoCommand is being executed. In the documentation is seems as though I
>> could set the "id" of the QUndoCommand to -1 and NOT have it executed but
>> after looking more close at the docs and the actual source code the
>> QUndoCommand will definitely be executed when pushed onto the stack. This
>> behavior does not make sense to me and I am probably missing something
>> simple about how to use the QUndoStack. Could someone offer an explanation
>> of why my command gets executed? And also how do I get my undocommand on the
>> stack **without** executing the command?
>
> I haven't used QUndoStack much myself, but to me what you describe
> does not make sense. An undo stack is supposed to represent what has
> happened (this history), so why should a command not be executed when
> pushed? Is it that you have already executed it manually?
>
> Either way, I think a command will always be executed when pushed, so
> that's what you need to work with. The -1 id thing seems to be just
> for controlling the merging behavior.
>
> Elvis
>
>> Thanks
>>
>> --
>> Michael A. Jackson
>> BlueQuartz Software, LLC
>> [e]: mike.jackson at bluequartz.net
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list