Ok, this thing you are trying to do with this flag has no sense.
MyGroupItem::shape - inherited from QGrphicsItem::shape and this takes boundingRect of item as a shape
MyGroupItem::boundingRect - inherited from QGraphicsItemGroup::boundingRect - takes QGraphicsItem::childrenBoundingRect - union of boundingRect of children
So you are try clip children to rectangle which covers whole content of all children so effectively no clipping should be done! The thing you are doing has no point!
I can't prove it but I suspect that some optimization of childrenBoundingRect takes into account QGraphicsItem::ItemClipsChildrenToShape flag (it should) so as a result you have circular dependency boundingRect is calculated based on shape and shape is calculated based on boundingRect when this flag is set and that is why you have unexpected outcome.
So I thing you should reimplement shape method so setting of QGraphicsItem::ItemClipsChildrenToShape would have some sense and to break possible circular dependency.




Reply With Quote
Bookmarks