curve->setData(QwtArray<QwtDoublePoint>());
Uwe
curve->setData(QwtArray<QwtDoublePoint>());
Uwe
Astronomy (15th January 2010)
Hi Uwe,
thanx for the reply.
that 's actually what i'm doing now. But with a QVector<double> Data and; curve->setData( Data1 ); and overwriting it with new Data..
The Question is:
1) If Data1 has 100 Entries and Data2 has less entries, eg. Data2[20] ; curve->setData( Data2 ) what does happen? Are the last 80 Entries the Old Data?
2) Or is the Memory, which was first located for 100 Entries now freed? Or are 80 Entries reserved with 0.0
( I have really big Data...) i'm going to debug 1) + 2)..
3) If you suggest with curve->setData(QwtArray<QwtDoublePoint>());, a simple overwrite, i have to overwerite the whole size of the Array with "0.0" for doing the clear() job?
Background:
I'm using CZoomer for zooming and i'm loading several Data1,2,3,.... in QwtPlot MyPlot two QwtPlotCurve MyCurve1 and QwtPlotCurve MyCurve2.
And for unknown reasons the Data i've erased from MyCurve, is sudden visible again if i zoom out? Maybe it's an CZoomer problem, but i was thinking, that it is because of QwtPlotCurve has no nice clear() Funktion?
greetings Astronomy
Last edited by Astronomy; 15th January 2010 at 16:43.
Ah i just found out:
So SetData does make a total clearance if new data is inserted.
void QwtPlotCurve::setData(const QPolygonF &data)
#endif
{
delete d_xy;
d_xy = new QwtPolygonFData(data);
itemChanged();
}
or
void QwtPlotCurve::setData(const QwtData &data)
{
delete d_xy;
d_xy = data.copy();
itemChanged();
}
Thanks to Uwe the trick with: curve->setData(QwtArray<QwtDoublePoint>());
worked.
I do not quite understand why ::setData(const QPolygonF &data) needs a new operator in the implementation and ::setData(const QwtData &data) below not. As i know, after each delete must follow a new operator? But as long as it works it should not bother me (-;
regards A.
Bookmarks