Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

geometry of QGraphicsRectItem



  • I have a qgraphicsRectItem drawn on a qgraphicsScene. With mouse events, it's being moved over the scene, resized and repositioned. How can I get the geometry of that qgraphicsRectItem boundingRect, pos wrt scene on mouseReleaseEvent? There's a image on scene, and a boundingrect of qgraphicsRectItem is drawn on the scene, then i need to get qrect for cropping that portion of image within the bounding rect.



  • You can use sceneBoundingRect() and scenePos() of the QGraphicsRectItem get the boundingRect and pos in the scene coordinate


Log in to reply