Quote Originally Posted by kuzulis View Post
Do you mean to use the set of setSamples() methods?
No:

Qt Code:
  1. class YourData: public QwtSeriesData<QPointF>
  2. {
  3. virtual size_t size() const override
  4. {
  5. return ...;
  6. }
  7.  
  8. virtual QPointF sample( size_t i ) const override
  9. {
  10. return ...;
  11. }
  12.  
  13. virtual QRectF boundingRect() const override
  14. {
  15. // be careful with not introdicing a performance bottleneck here
  16. // better calculate it in advance an cache it
  17. return ...;
  18. }
  19. };
  20.  
  21. curve->setData( new YourData() );
To copy to clipboard, switch view to plain text mode 

It's totally up to you how these methods are implemented, but I guess they return values from some custom buffer. How these values come to this buffer is up the the application, Qwt does not see it.

setSamples()
Qt containers are implicitly shared: see http://doc.qt.io/qt-5/implicit-sharing.html.

So if you load your values only for the purpose of displaying it on the plot using a QPolygonF + setSamples is just fine. The only thing you could consider is to call setSamples( QPolygonF() ) before loading a new set of samples. Otherwise you need memory for 2 buffers until you can pass the new one in.

Uwe