How can a QGraphicsRectItem retrieve the coordinate of its top left corner, relative to the scene it is associated with? I tried working with boundingRect().x(), but these coordinates are outdated after the item is dragged across the scene. scenePos().x() always returns 0 for some reason.

I'm asking because I want to implement my own mousePressEvent on a class that derives from QGraphicsRectItem. I need to know if the user clicked in a corner of the rectangle or not so that I can allow the shape to be resized using selection grips.