Question

I need to get the coordinates of a QImage of where the mouse is currently hovering. Like in image editing programs, where we can see the coordinates of the pixel the mouse in currently hovering.

Was it helpful?

Solution

Call setMouseTracking(true), and override mouseMoveEvent. Your mouseMoveEvent function will be called whenever the mouse moves inside the QImage. (You have to create a subclass of QImage to do this.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top