robin2000
14th August 2009, 08:17
hi,
i have a QGraphicsItemGroup with several items in it. The boundingRect is computed correctly according to the current boundingRects of the group members. Now i change the size of one member in the group, so that his boundingRect exceeds the group's boundingRect.
But when I call group.boundingRect(), it was not updated. Is there any way to manually update the boundingRect of an existing item group? Even implementing an inherited version of boundingRect() in a child class of QGraphicsItemGroup does not work, because boundingRect in QGraphicsItemGroup is not virtual thus the graphics engine would only call the ancestors version, when treating the object as a QGraphicsItem.
The only workaround i found is to remove an item from the group and adding it again, because then the boundingRect stored in the private variable d->itemsBoundingRect is updated. But that can't be the solution.
I'd be grateful for any ideas.
i have a QGraphicsItemGroup with several items in it. The boundingRect is computed correctly according to the current boundingRects of the group members. Now i change the size of one member in the group, so that his boundingRect exceeds the group's boundingRect.
But when I call group.boundingRect(), it was not updated. Is there any way to manually update the boundingRect of an existing item group? Even implementing an inherited version of boundingRect() in a child class of QGraphicsItemGroup does not work, because boundingRect in QGraphicsItemGroup is not virtual thus the graphics engine would only call the ancestors version, when treating the object as a QGraphicsItem.
The only workaround i found is to remove an item from the group and adding it again, because then the boundingRect stored in the private variable d->itemsBoundingRect is updated. But that can't be the solution.
I'd be grateful for any ideas.