Thanks, KiriM.

I had to implement some tweaks to get this to work in qwt-6.0.0 because the draw() function is different in 6.0.0.

I overrode QwtPlotCurve::drawSeries(), included the QRectF of the canvas in it's constructor, and used the d_deries->samples(i).y() data-values in the comparison to "gapValue_"
Qt Code:
  1. ////////////////////////////////////////////////////////////////////////////////
  2. void QwtPlotGappedCurve::drawSeries(QPainter *painter, const QwtScaleMap &xMap,
  3. const QwtScaleMap &yMap, const QRectF &canvRect, int from, int to) const
  4. {
  5. if ( !painter || dataSize() <= 0 )
  6. return;
  7.  
  8. if (to < 0)
  9. to = dataSize() - 1;
  10.  
  11. int i = from;
  12. while (i < to)
  13. {
  14. // If data begins with missed values,
  15. // we need to find first non-missed point.
  16. double y = d_series->sample(i).y();
  17. while ((i < to) && (y == gapValue_))
  18. {
  19. ++i;
  20. y = d_series->sample(i).y();
  21. }
  22. // First non-missed point will be the start of curve section.
  23. int start = i;
  24. y = d_series->sample(i).y();
  25. // Find the last non-missed point, it will be the end of curve section.
  26. while ((i < to) && (y != gapValue_))
  27. {
  28. ++i;
  29. y = d_series->sample(i).y();
  30. }
  31. // Correct the end of the section if it is at missed point
  32. int end = (y == gapValue_) ? i - 1 : i;
  33.  
  34. // Draw the curve section
  35. if (start <= end)
  36. QwtPlotCurve::drawSeries(painter, xMap, yMap, canvRect, start, end);
  37. }
  38. }
  39.  
  40. ////////////////////////////////////////////////////////////////////////////////
To copy to clipboard, switch view to plain text mode