You right, the second implementation is not even compile and not even written right. The thing is that I'm unable to right it proper way, that's the other thing.
And I came to this conclusion because, the line setRawSamples() is working fine if the data is not too fast, but if I given bulk or fast data its crashing at this point.
Qt Code:
  1. void Input::plottingData(QVariant data)
  2. {
  3. if (data.userType() == QMetaType::QPointF)
  4. {
  5. m_points.push_back(data.toPointF());
  6. }
  7. if (data.userType() == QMetaType::Double)
  8. {
  9. double yValue = data.toDouble();
  10.  
  11. cframe::TimeStamp time = Module::createTimestamp();
  12. qint64 nanoElapsed = time.nSecsElapsed();
  13. double xValue = nanoElapsed/(double)1000000000;
  14. m_points.push_back(QPointF(xValue, yValue));
  15. }
  16. if (data.userType() == qMetaTypeId<QVector<QPointF>>())
  17. {
  18. QVector<QPointF> points = data.value<QVector<QPointF>>();
  19. m_points.append(points);
  20. }
  21.  
  22. m_curve.setSamples(m_points);
  23. }
To copy to clipboard, switch view to plain text mode 

Can you please check this code above and clarify does the problem is in the coding somewhere ?

Thanks