PDA

View Full Version : how to Update the boundingRect of a QGraphicsItemGroup



zhy0808
30th September 2010, 19:46
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?

Lykurg
30th September 2010, 19:55
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.

jonks
25th October 2010, 14:02
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.

tryptik
12th July 2011, 20:48
Is this going to be fixed? It's kind of annoying - maybe a method to force a recalc at least?