-3

thank you for helping me use the method of closestPoint qwt to recover the value of y corresponds to a value x. I put that but still the problem of syntax ?

error: invalid type '<unresolved overloaded function types> [int]' for array subscript 

Code:      

Curve-> closestPoint (pos [0], NULL); 
Jablonski
  • 18,083
  • 2
  • 46
  • 47
Hatim
  • 3
  • 1

1 Answers1

0

You get this error because you call some method, but you use [] instead of ()so you should use:

Curve->closestPoint(pos(), NULL); 

As doc said closestPoint requires QPoint

int QwtPlotCurve::closestPoint (const QPoint & pos, double * dist = NULL ) const

For example:

Curve->closestPoint(QPoint(1,1),NULL);
Jablonski
  • 18,083
  • 2
  • 46
  • 47