PDA

View Full Version : chase mouse x,y values



saman_artorious
8th April 2013, 08:15
As mouse moves on my widget, I want to show mouse x n y values aside the mouse pointer, preferably in a small pop-up.
any tips for this please?

alizadeh91
8th April 2013, 08:28
first set mouseTracking to true then implement mouseMoveEvent(qmouseEvent *e). from argument you can get x and y coordinate of mouse

saman_artorious
8th April 2013, 09:27
Yeap, got it.
I also want to know how to show x and y values right aside the mouse pointer in a pop-up window or whatever.

alizadeh91
8th April 2013, 09:29
it's property of widget(dialog). setMouseTracking(true) in constructor

saman_artorious
8th April 2013, 10:26
it's property of widget(dialog). setMouseTracking(true) in constructor

I also want to know how to show x and y values right aside the mouse pointer in a pop-up window or whatever.

wagmare
9th April 2013, 09:15
I also want to know how to show x and y values right aside the mouse pointer in a pop-up window or whatever.

use toolTip to show the value of x() and y() after u reimplement the mousePressEvent event->pos() .