# Thread: How to show the value of a point under the mouse?

1. YaK
Novice
Join Date
Nov 2008
Posts
27
Qt products
Platforms

## How to show the value of a point under the mouse?

I need to show it when the mouse is being dragged above the Qwt plot, even without pressing any buttons. I know, that it's simple, but how?
Last edited by YaK; 27th February 2009 at 06:38. Reason: reformatted to look better

2. Uwe
Expert
Join Date
Feb 2006
Location
Munich, Germany
Posts
3,316
Thanked 879 Times in 827 Posts
Qt products
Platforms

## Re: How to show the value of a point under the mouse?

picker->setTrackerMode(QwtPicker::AlwaysOn);

3. ## The following user says thank you to Uwe for this useful post:

Carlton (28th March 2009)

4. YaK
Novice
Join Date
Nov 2008
Posts
27
Qt products
Platforms

## Re: How to show the value of a point under the mouse?

Originally Posted by Uwe
picker->setTrackerMode(QwtPicker::AlwaysOn);
Thank you, comrade. Yet a few more questions: can i show some rounded value with less digits into the frac. part and can i show the value of the CURVE f(x) under the same X value, that is shown on the plot?

5. Novice
Join Date
Apr 2008
Posts
32
Thanks
3
Thanked 5 Times in 5 Posts
Qt products
Platforms

## Re: How to show the value of a point under the mouse?

Originally Posted by YaK
Thank you, comrade. Yet a few more questions: can i show some rounded value with less digits into the frac. part and can i show the value of the CURVE f(x) under the same X value, that is shown on the plot?
Rounding algo should be set by using QwtPicker::trackerText function.
Showing value of f(x) - I think this should be your function - first it should calculate x value of picker, then it should iterate through your curve and find this exact x value, or interpolate y value if picker's x value lies between two points of your curve.

This value should be given to picker to show, or put some label, or write this value in statusBar, it's up to you.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.