How to clear QwtPlot curves before relaying?

In earlier versions Qwtwe add QwtPlot::clear(), but now I can not find it.

Any ideas? I have a real-time chart, so when retransmitting information before xmin is not very important and over time it fails, because the replica relays all the information to xmin.

+5
source share
2 answers

The method is Qwtplot::clear()deprecated. Use instead QwtPlotDict::detachItems.

void QwtPlotDict::detachItems(int rtti = QwtPlotItem::Rtti_PlotItem, 
                              bool autoDelete = true 
                             )

Parameters:

rtti : in the case of QwtPlotItem :: Rtti_PlotItem, separate all elements, otherwise only those elements of type rtti. autoDelete : if true, delete all individual elements

+5
source

, : : (m_vctTime, m_vctValue -vector) (curve = new QwtPlotCurve()) (plot = new QwtPlot ())

m_vctTime.clear();
m_vctValue.clear();
curve->setSamples(m_vctTime,m_vctValue);
plot->replot();    

+1

All Articles