Get pixel position under mouseclick in QGraphicsPixmapItem
zed961 last edited by zed961
What I want to achieve
I want to create a QGraphicsViewer that can zoom in,out and get the position of a pixel under mouseclick from an image.
What I did so far
I've successfully created my QGraphicsViewer that can zoom in on the image.
How to get the pixel position (X,Y) of the image under the mouseclick? A simple mouseclick event is not working as it's not taking into account that the image scales after zooming see image bellow.
No Zoom: Notice the pixel at 2,2 at the top.
After Zooming: pixel at 2,2 is different from the first image.
zed961 last edited by
Create a customScene, override mousepressevent and use scenePos().