I'm trying to convert a sprite (QGraphicsPixmapItem) to a polygon (QGraphicsPolygonItem).

I know Qt creates some kind of boundary region because when the contains() call accurately returns only when I am actually clicking on the item (after I do the mapToScene() call).

When I try to get the QGraphicsPixmapItem::boundingRegion(QTransform) it crashes. I'm not sure I have the right idea in using this function because why would it accept a transform?

There's also a QGraphicsPixmapItem method that returns a QPolygonF called "mapToScene". But I don't think that's what I want either since you have to pass a polygon to the QGraphicsPixmapItem to get a polygon back. That doesn't seem to quite make sense for what I'm trying to do.

I'd eventually like to create a QGraphicsPolygonItem from the QGraphicsPixmapItem coordinates.

Any ideas?