Results 1 to 10 of 10

Thread: How to know the value of a point on the graph?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,325
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to know the value of a point on the graph?

    Quote Originally Posted by oddytz1989 View Post
    Could you tell what I need to fix?
    Sorry I wrote nonsense of course QwtPlotCurve::closestPoint want a point in widget coordinates. You have to write something like this:

    Qt Code:
    1. connect( picker, SIGNAL( selected( const QPolygon & ), SLOT(UpdVizir( const QPolygon & )));
    To copy to clipboard, switch view to plain text mode 
    and

    Qt Code:
    1. void TrendTop::UpdVizir( const QPolygon &points )
    2. {
    3. if ( points.size() != 1 )
    4. return; // should never happen for point selections
    5.  
    6. double dist;
    7. int index = curv1->closestPoint( points[0], &dist );
    8. if ( index >= 0 && dist <= ... )
    9. {
    10. const QPointF found = curv1->sample( index );
    11. ....
    12. }
    13. }
    To copy to clipboard, switch view to plain text mode 

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

    oddytz1989 (14th February 2012)

Similar Threads

  1. Replies: 3
    Last Post: 21st June 2011, 19:37
  2. Replies: 1
    Last Post: 3rd December 2009, 14:23
  3. display a plot point by point
    By oswalidos in forum Newbie
    Replies: 32
    Last Post: 13th March 2009, 15:37
  4. graph
    By sonu111 in forum Qwt
    Replies: 1
    Last Post: 15th December 2008, 22:14
  5. how to paint scene point by point
    By elessaar in forum Qt Programming
    Replies: 8
    Last Post: 4th September 2008, 20:00

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
  •  
Qt is a trademark of The Qt Company.