Hi,

I have extended the class QwtPlot like the example "Oscilloscope". I must write a similar code but more simple. I have a thread "out of my control" that emit a signal each 100 msec. I have write in my custom class this slot:

Qt Code:
  1. void Plot::addSampledPoint(double time, double sample)
  2. {
  3. samples.append(QPointF(time, sample));
  4. d_curve->setSamples(samples);
  5.  
  6. const QwtScaleMap xMap = canvasMap( d_curve->xAxis() );
  7. const QwtScaleMap yMap = canvasMap( d_curve->yAxis() );
  8. QwtSeriesData<QPointF> *data=d_curve->data();
  9.  
  10. QRectF br = qwtBoundingRect( *data, 0, data->size()-1 );
  11. const QRect clipRect = QwtScaleMap::transform( xMap, yMap, br ).toRect();
  12. d_directPainter->setClipRegion( clipRect );
  13. d_directPainter->drawSeries(d_curve, 0, data->size()-1);
  14. }
To copy to clipboard, switch view to plain text mode 

When the samples are a QVector compatible with setSamples. I have no error but when I start the sampling I don't see anything.

P.s. If I initialize the samples when I write d_curve->attach(this) I van see the point.

Any suggest? Sorry for my simple English. (Obviously thank you at all).