View Full Version : How to get the x an y corrdinates from mouse postion

16th May 2008, 23:21

I am trying the realtime_plot example how can I set the
mouseTracking to true so that I can get he mouse postion which can be passed to the Qwtplotpicker to get the trackText and can be outputed to a status bar

But even If I have set the mouse tracking(setMouseTracking(true)) to true in the IncrementalPlot I am not able to get the mouse move event in the virtual event()(Qwtplot) which I have rewritten in incremental plot.

I only able to get this event only when I click the left mouse button and move it.

Please let me know how to get the mouse event even when it is not clicked.

17th May 2008, 10:11
Mouse tracking has to be enabled for the viewport, I assume QwtPlot has one...

17th May 2008, 16:02
With picker->setDisplayMode(QwtPicker::AlwaysOn) the positions is always displayed.

If you want to see that the QwtPlotPicker::moved() signal is emitted - even when the mouse is not pressed - there are many different ways to do it. Probably the most easiest one is to overload QwtPlotPicker::widgetMouseMoveEvent this way:

YourPicker::widgetMouseMoveEvent(QMouseEvent *me)
emit moved(invTransform(me->pos));