Hi everyone. I have a problem of how to draw a cruve with growing data. In my application, i need to draw a curve which data is collected from AD channel. I found the "realtime_plot" example, it used the draw(from,to) method. So i use this code for reference. But in my code, it doesn't work. My code like this:
d_data->append(x, y, size);
d_curve->setRawData(d_data->x(), d_data->y(), d_data->count());
canvas()->setPaintAttribute(QwtPlotCanvas::PaintCached, false);
d_curve->draw(d_curve->dataSize() - size, d_curve->dataSize() - 1);

used above code, the cruve desn't show, but used replot() method, the curve can display:
d_data->append(x, y, size);
d_curve->setRawData(d_data->x(), d_data->y(), d_data->count());
canvas()->setPaintAttribute(QwtPlotCanvas::PaintCached, false);
replot();

so i want to ask , how to used draw(from,to) method? And i want to draw a curve as quickly as it can. QPaintEngine::PaintOutsidePaintEvent feathure is needed, but it is not supported by qt4, and how i can realize?