Details
-
Suggestion
-
Resolution: Unresolved
-
P4: Low
-
None
-
None
-
n/a
Description
QGraphicsItemGroup's addToGroup method takes only one single item as argument. This method results in the recalculation of it's bounding rectangle, which is an O operation, where n is the number of actual items in the group. Therefore adding k elements takes time proportional to k^2, which can be very painful, obviously.
Suggestion: there should be a beginAddToGroup() and endAddToGroup() method, and between calling those two, the bounding rect should not be updated.