QT pixel position from image on mouse click

I use QGraphicView and QGraphicScene for display and image. I would like to get the pixel coordinate of the image when I click on that pixel. To do this, I use mousePressEvent and implement a function to position the isplay event. But the problem is that the pixel position of the image is wrong, because I get the pixel coordinate corresponding to the graphic image, and not the pixel coordinate in the image. I think this will give me the correct answer when the view is exactly the same size as the image (at least how to do it?), But I prefer a more complex solution.

Please, help

+3
source share
1 answer
0

Source: https://habr.com/ru/post/1760406/


All Articles