Results 1 to 5 of 5

Thread: QwtPlotCurve update problem

  1. #1
    Join Date
    Mar 2018
    Posts
    5
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default QwtPlotCurve update problem

    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:
    Qt Code:
    1. d_curve->setPen( Qt::red, 4.0, Qt::SolidLine );
    To copy to clipboard, switch view to plain text mode 

    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

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlotCurve update problem

    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

  3. #3
    Join Date
    Mar 2018
    Posts
    5
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: QwtPlotCurve update problem

    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.
    Last edited by knarfS; 2nd March 2018 at 17:21.

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlotCurve update problem

    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

  5. #5
    Join Date
    Mar 2018
    Posts
    5
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: QwtPlotCurve update problem

    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.

Similar Threads

  1. Problem with QwtPlotCurve::drawLines() function
    By vinothrajendran in forum Qwt
    Replies: 1
    Last Post: 8th February 2015, 11:46
  2. Replies: 8
    Last Post: 9th February 2014, 13:37
  3. Replies: 8
    Last Post: 18th October 2012, 08:23
  4. Replies: 1
    Last Post: 11th May 2012, 09:02
  5. problem in : QwtPlotCurve::Fitted
    By mammaiap in forum Qwt
    Replies: 3
    Last Post: 2nd February 2011, 13:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.