Results 1 to 4 of 4

Thread: how to Update the boundingRect of a QGraphicsItemGroup

  1. #1

    Question how to Update the boundingRect of a QGraphicsItemGroup

    i have a QGraphicsItemGroup with several items in it.But the QGraphicsItemGroup's boundingRect is not changed when i change the size of one member in the group. Is there any way to manually update the boundingRect of an existing item group?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: how to Update the boundingRect of a QGraphicsItemGroup

    Do you use custom items in the group? If so, you probably do not update the bounding rect there.


    EDIT: Ehm, a quick look into the sources puzzels me. It seems the group only recalc the rect when you add or remove an item.
    Last edited by Lykurg; 30th September 2010 at 20:00.

  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: how to Update the boundingRect of a QGraphicsItemGroup

    I had exactly the same problem.
    Solved it using Lykurg's observation. - when I move an object, I check to see if it has a parent.
    If it has a parent, I remove it from the parent, and then re-add it again.

  4. #4
    Join Date
    Jul 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to Update the boundingRect of a QGraphicsItemGroup

    Is this going to be fixed? It's kind of annoying - maybe a method to force a recalc at least?

Similar Threads

  1. Replies: 2
    Last Post: 29th September 2010, 17:44
  2. boundingRect()?
    By aaron in forum Qt Programming
    Replies: 6
    Last Post: 21st April 2009, 09:43
  3. copying QGraphicsItemGroup
    By robertson1 in forum Qt Programming
    Replies: 1
    Last Post: 23rd June 2008, 07:48
  4. Add two QGraphicsItemGroup
    By ashishsaryar in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2008, 18:00
  5. setZValue of QGraphicsItemGroup
    By forrestfsu in forum Qt Programming
    Replies: 3
    Last Post: 6th November 2006, 19:40

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.