You can't. That's the point when I said it's useless, because every shape might be complex. If you expect an ellipse, you can compute its shape, but if you want to handle any shape, calculating its shape is complex and is equal to drawing the shape on a bitmap and then looking which points are filled and which are not and returning the bitmap mask as a shape.
But it's a complex shape, so calculating it according to your method would result in an empty painter path. Now if you have an object composed of two nodes - an ellipse and a "whatever", your idea would result in a painter path that only contains the ellipse. And that's certainly not the shape you'd be looking for.And what iif the object is a path (a pentagon, a star, or whatever?). You can't tell anything from the boundingRect, but the node itself can.
I suggest you try with the masking approach and see if it's fast enough for you. So when you scale your svg item, draw it to a pixmap and create a mask for it. Then use the mask to calculate hits yourself or use some heuristics to calculate the shape. See QGraphicsPixmapItem for details on how its shape is calculated.
I understand that the shape of a QGraphicsSvgItem is, in principle, complex to determine, but I'm referring to single objects inside the SVG tree, which are quite simple, and in general associated to a QSvgNode, which has a definite shape that's it's completely hidden to the user.
Bookmarks