I want to delete all items from my plot. I found this:
plot->detachItems( QwtPlotItem::Rtti_PlotCurve ,true);
But, it does not delete clearly. Somethings remains background. I tried on a example. And memory leaks occurs. How can clear all plot?
Thanks for advices.
You should call
QwtPlot::replot() after modifying your plot. Add this line after your code:
Or you can enable auto replot during initialization,
QwtPlot::setAutoReplot(true), that way you don't have to call replot every time you change something. On the other hand, if you frequently update your plot, I would advise agains auto replot due to performance reasons. It's better to call
replot() explicitly in such case.