I have to develop an image editor. The last feature I'm missing for it is cropping the image using a QRubberBand
, and then crop the selected area using a push button.
There are reports of subclassing QGraphicsView
, but I don't know how to connect it to the UI.
First you have to build a QRect with the area of the picture that you want to keep.
Then you can use the copy method on QImage to create a new picture containing only the rectangle area.
Next use a QGraphicsPixmapItem to add your picture in the scene :
Good luck !