This is another about updating a QwtPlotCurve as new data arrives from a time-sensitive source. Refer to the oscilloscope example but create a sweep effect instead of clearing on each restart.
Using Qt 4.8 and qwt-6.0.1, currently developing on Windows and the app will also be on Linux.
Bursts of data arrive, say 50 at a time, up to 100000, then repeat. To update an existing section, first set a QwtPlotDirectPainter pen to black, slightly wider than the actual curve, and redraw the 50 old points. Second I have an overloaded hook to QwtSeriesData->replace(), so update the 50 points. Finally change the DirectPainter pen to normal and draw the new section.
The problem - DirectPainter black pen erases QwtPlotGrid where they overlap. The z value is 10 for grid and 20 for plot curve. Changing these during initialization or before painting makes no difference.
As a guess, does DirectPainter ignore this and assume that its curves are always supposed to be on top?
Several workarounds come to mind but all require a replot. The idea of clip regions is a bit fuzzy, not sure if this means a rectangle or other shape is the only part replotted. I have not run across examples that fit here.
Am I missing something or any suggestions to get the grid points back, or replot only a region?
Thanks,
Scott
Bookmarks