PDA

View Full Version : Removing/popping items from QUndoStack



brcain
17th December 2013, 00:31
Hello,

Is there any way to remove/pop items from a QUndoStack ... starting from an index and everything thereafter?
The reason I need to do this is related to another problem I'm having with redo commands related to item groups (forum post, 'QGraphicsItemGroup and undo/redo error' (http://www.qtcentre.org/threads/57302-QGraphicsItemGroup-and-undo-redo-error)).

Do I need to derive from QUndoStack to implement the behavior? Is this considered "bad form"?

BTW, I know it's possible to remove all items with the clear() method. I don't see how to "pop" an item or two off.

Regards,
Ben

wysota
17th December 2013, 07:48
How about not spawning three threads for the same issue? :)

brcain
17th December 2013, 13:54
Yea, bad form for three threads ... was late I guess. My bad ;)
But, I did learn from my attempted work-arounds.