Reputation: 940
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.
Upvotes: 2
Views: 2025
Reputation: 17114
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.)
Upvotes: 6