jonks
27th October 2010, 15:03
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?
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?