PDA

View Full Version : Mouse Event



cemshit
27th January 2010, 20:00
Hi,

I am new to QT and C++ programming but I have experience programming. I need to know the mouse position when it is clicked. I know there is class for this purpose but I don't know exaactly how I can use it. Can anybody show a basic example with mouse event?

Thanks

squidge
27th January 2010, 20:50
QMouseEvent will give you a QPoint reference, so you can simply use the 'x' and 'y' members of that class to get the position at the time of the event.

There are plenty of examples that come with Qt which demonstrate this class.