PDA

View Full Version : QwtPlotCurve update problem



knarfS
2nd March 2018, 15:05
Hi there,

I have a problem with a QwtPlotCurve not updating correctly.
This could be observed with the oscilloscope example. The only thing i changed in the example code is the line color and width, so the problem is more highlighted:

d_curve->setPen( Qt::red, 4.0, Qt::SolidLine );

The curve is plotted with a line width of approximately 1px until the canvas is replotted by changing the window size or changing the displayed seconds. Only then the curve line has the desired 4px width.
Here are 2 pictures that show the problem: https://imgur.com/a/z9EoL

I'm using Debian testing with Qt 5.10 and Qwt 6.1.3. But I stumbled across the same issue 2 years ago with Qt 4.? and Qwt 6.? under Linux and Windows (I can't remember exactly which versions).
Is this a know problem? Am I doing something wrong? Couldn't find any problem like that.

Frank

Uwe
2nd March 2018, 15:52
The oscilloscope example is painting incrementally, so you won't have any updates of the previously rendered content only by changing the pen. You probably have to call replot manually once after changing the pen.

Uwe

knarfS
2nd March 2018, 16:21
HI Uwe,

thanks for your response. I'm not totally sure if i understand your answer.

I'm not changing the pen while rendering, I'm only changing the displayed seconds via the wheel.
The problem can also be observed with the original, unchanged oscilloscope example. I just added the setPen() in the Plot-ctor to show the problem more clearly.
I'm expecting the incremental plot using my _once_ set pen style, or am i wrong?

Frank

Added after 17 minutes:

To be more clear:
In the second picture, i changed the displayed seconds from 61 to 62 via the wheel at timestamp 876s, nothing else.
Then the already plotted curve used the correct line width, everything after the replot (from 876 onwards) uses the wrong line width.

Uwe
5th March 2018, 07:34
Yes I can confirm that when drawing incremental the pen width seems to be ignored - only its color is uses by the render backend. It happens with the raster and X11 paint engines so the problem should be somewhere in the device independent part. I did a quick debugging with what happens with the pen width and I can see, that inside of QPainter the correct pen width is used to initialize its internal stroker ...

When I have more time I will have a deeper look at it.

Uwe

knarfS
5th March 2018, 12:42
There is a closely related issue when you assign a QwtSymbol to the QwtPlotCurve. Maybe this helps troubleshooting:

Only the the part of the symbol that is on top of the 1px line is shown when drawing incremental. After a replot() the symbols are shown correctly, but the newly printed part did not show the full symbols and a line with width 1px.