Results 1 to 9 of 9

Thread: QGraphicsItemGroup and undo/redo error

Threaded View

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

    Default QGraphicsItemGroup and undo/redo error

    Hello,

    I've been using the Qt example project, undoframework, as a method for implementing undo/redo.
    It has worked great for moves, rotations, resizes, creations, and deletions.
    The approach uses lists of graphics items (QList<QGraphicsItems *>) for the redo and undo methods.

    I've encountered an error with undo/redo with creating groups demonstrated by the following sequence:
    1) create 2 items
    2) create group from the 2 items
    3) move group
    4) undo 2 times (to where 2 items are just created)
    5) redo (group operation)
    6) redo (move operation) <<--- error, new group item doesn't match move's redo item

    I create the group using QGraphicScene's createItemGroup() command. This creates a new pointer for the group each time it's called.
    The move operation maintains a list of graphics items (the group item in this instance). Since, the group item pointer is different, an error occurs when re-doing the move operation.

    Thanks,
    Ben
    Last edited by brcain; 17th December 2013 at 00:44.

Similar Threads

  1. qt undo/redo
    By giugio in forum Qt Programming
    Replies: 1
    Last Post: 12th November 2012, 16:31
  2. undo/redo example has refactored
    By n_vova in forum Qt Programming
    Replies: 1
    Last Post: 10th May 2012, 10:04
  3. Undo/Redo issues of QTextEdit
    By Maximka in forum Newbie
    Replies: 0
    Last Post: 22nd February 2010, 07:36
  4. QTextEdit undo/redo
    By Derf in forum Qt Programming
    Replies: 1
    Last Post: 6th August 2009, 09:12
  5. Implement Undo Redo
    By ankurjain in forum Qt Programming
    Replies: 5
    Last Post: 28th March 2006, 13:17

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.