Results 1 to 3 of 3

Thread: QGraphicsItemGroup bounding rect problem

  1. #1
    Join Date
    May 2009
    Posts
    63
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default QGraphicsItemGroup bounding rect problem

    If you drag a QGraphicsItem across a scene and then query it's bounding rect you will see that it's x,y co-ordinates are updated each time it is dragged.

    Do the same with a QGraphicsItemGroup, and it's bounding rect x,y co-ordinate is not updated.

    It appears to me that to update a QGraphicsItemGroup bounding rect you have to destroy the group then re-create it.

    The problem I'm having right now is, when using the command pattern for undo/redo dragging QGraphicsItemGroup items, it does not work because the bounding rect is never accurate.

    Is this a Qt bug, or am I misunderstanding the co-ordinate system when using QGraphicsItemGroups?

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

    Default Re: QGraphicsItemGroup bounding rect problem

    Quote Originally Posted by jonks View Post
    If you drag a QGraphicsItem across a scene and then query it's bounding rect you will see that it's x,y co-ordinates are updated each time it is dragged.
    No, they are not.
    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
    May 2009
    Posts
    63
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QGraphicsItemGroup bounding rect problem

    Thank you - you identified the mistake in my thoughts and now I know why my groups bounds are never updated.

Similar Threads

  1. Replies: 0
    Last Post: 1st July 2010, 18:17
  2. QGraphicsSvgItem, problem with scaling (invalid bounding rect)
    By Józef Paczenko in forum Qt Programming
    Replies: 3
    Last Post: 8th June 2010, 08:58
  3. Replies: 1
    Last Post: 19th December 2009, 15:46
  4. hide bounding rect
    By dreamer in forum Qt Programming
    Replies: 1
    Last Post: 8th May 2008, 09:40
  5. Image format without bounding rect
    By dreamer in forum Qt Programming
    Replies: 5
    Last Post: 30th April 2008, 22:25

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.