Results 1 to 4 of 4

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

  1. #1
    Join Date
    Nov 2008
    Posts
    27
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy 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. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,318
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default 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. #3
    Join Date
    Nov 2008
    Posts
    27
    Qt products
    Qt4
    Platforms
    Windows

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

    Quote Originally Posted by Uwe View Post
    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. #4
    Join Date
    Apr 2008
    Posts
    32
    Thanks
    3
    Thanked 5 Times in 5 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11

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

    Quote Originally Posted by YaK View Post
    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.

Similar Threads

  1. Replies: 4
    Last Post: 4th February 2008, 06:16

Bookmarks

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.