Qt使用Qwt插件画曲线,该怎么解决

Qt使用Qwt插件画曲线
curve->setRenderHint(QwtPlotItem::RenderAntialiased,true);
curve->setCurveAttribute(QwtPlotCurve::Fitted,true);
这两句代码是使曲线平滑弯曲吗?
我执行后的一开始的结果是对的:
Qt使用Qwt插件画曲线,该怎么解决
但是到后面的曲线变成了折现,而且不经过数据点:
Qt使用Qwt插件画曲线,该怎么解决
求大神指点下,这到底是这么回事?
------解决思路----------------------
setSamples( const double *xData, const double *yData, int size );你的qwt是哪个版本?

curve->setSamples(time,val);后面还有一个size的参数吧。另外你的数据要全部都显示吗?如果只需显示最新的一部分,数据多了之后,再插入新数据前,先移去一个最旧的数据
val.pop_front();
time.pop_front();
------解决思路----------------------
引用:
Quote: 引用:
我猜应该就是点太多导致的
你看看setCurveAttribute(QwtPlotCurve::Fitted,true);第一个参数的说明
 /*!
          Only in combination with QwtPlotCurve::Lines
          A QwtCurveFitter tries to
          interpolate/smooth the curve, before it is painted.

          \note Curve fitting requires temorary memory
          for calculating coefficients and additional points.
          If painting in QwtPlotCurve::Fitted mode is slow it might be better
          to fit the points, before they are passed to QwtPlotCurve.
         */
我刚才试,点多了以后也有问题。

画曲线不可能会点少的啊!这该怎么解决啊Qt使用Qwt插件画曲线,该怎么解决
你不能减少点,点多了之后就别平滑处理了不就行了?或者换一种显示的方式,比如改成填充的Qt使用Qwt插件画曲线,该怎么解决