Qwt display coordinates label
Hi,
I've read this thread (from almost three years ago): http://www.qtcentre.org/threads/2659...-QLabel-widget.
Now, since then, I was wondering if to display the coordinates of the cursor in some sort of label, if I would need to subclass qwtplotpicker, and reimplement the protected trackerText function, or if since then, Qwt 6.0.1 has a better way of doing this.
If this question has already been answered (I've looked, but you never know), please point me to the question.
Thanks again for your time.
Re: Qwt display coordinates label
If QwtPicker::trackerText() isn't enough you could install event filter on the canvas and handle the QEvent::MouseMove event.
In there you'll get screen coordinates which you can translate to world coordinates using QwtPlot::invTransform().
Now you can display any of those values wherever you want.
If you need, for example point closest to the cursor along it's y axis, then you need to do some extra calculations but that would be your starting point.
Re: Qwt display coordinates label
Or use the QwtPlotPicker::selected() signals. Guess you want to use point selection in combination with with a QwtPickerTrackerMachine.
Uwe