2014-10-28 32 views
-3

感謝您幫助我使用closestPointqwt的方法來恢復y對應於值x的值。我說,但仍然是語法問題?帶有closestPoint語法的問題qwt

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

代碼:

Curve-> closestPoint (pos [0], NULL); 

回答

0

因爲你調用一些方法你得到這個錯誤,但是你用[]代替()所以你應該使用:

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

正如docclosestPoint要求QPoint

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

例如:

Curve->closestPoint(QPoint(1,1),NULL);