PDA

View Full Version : curve is not smooth enough with many sample points .



lwz
28th August 2013, 11:38
Hello, my problem is Curve is not smooth enough . Size of the green curve'samples is 10, while the red one's more than 100 .As the picture shows , the green one looks much smoother than the red one . How can I make it smoother ? Please check my code and help me out .


QwtSplineCurveFitter *f1 = new QwtSplineCurveFitter();
f1->setFitMode(f1->Spline);
QPen pen(Qt::red);
pen.setWidth(1.5);
curve->setCurveFitter(f1);
curve->setSamples(points);// Size of points is above 100.
curve->setCurveAttribute(QwtPlotCurve::Fitted,true);
curve->setPen(pen);
curve->setStyle(QwtPlotCurve::Lines);
curve->setRenderHint( QwtPlotItem::RenderAntialiased,true);
curve->attach(this);

9489