Results 1 to 3 of 3

Thread: Removing/popping items from QUndoStack

  1. #1
    Join Date
    Feb 2006
    Location
    US
    Posts
    173
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android
    Thanks
    16
    Thanked 5 Times in 5 Posts

    Default Removing/popping items from QUndoStack

    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').

    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
    Last edited by brcain; 17th December 2013 at 01:44.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Removing/popping items from QUndoStack

    How about not spawning three threads for the same issue?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Feb 2006
    Location
    US
    Posts
    173
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android
    Thanks
    16
    Thanked 5 Times in 5 Posts

    Default Re: Removing/popping items from QUndoStack

    Yea, bad form for three threads ... was late I guess. My bad
    But, I did learn from my attempted work-arounds.

Similar Threads

  1. removing items QTreeWidget
    By Mystical Groovy in forum Qt Programming
    Replies: 3
    Last Post: 25th March 2015, 22:58
  2. Removing all Items from QListView
    By subrat17june in forum Qt Programming
    Replies: 1
    Last Post: 6th June 2013, 12:07
  3. Replies: 0
    Last Post: 3rd August 2010, 12:47
  4. Removing all items QListView
    By vcp in forum Qt Programming
    Replies: 2
    Last Post: 6th August 2009, 19:55
  5. Removing items from QtableWidget
    By algajard in forum Qt Programming
    Replies: 1
    Last Post: 17th March 2009, 10:31

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.