Results 1 to 3 of 3

Thread: How to temporarily disable a redraw of one of the curves

  1. #1
    Join Date
    Jan 2009
    Posts
    47
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default How to temporarily disable a redraw of one of the curves

    I have a QwtPlot that contains a QwtPlotCurve and one or many custom QwtPlotItem. The QwtPlotCurve can be big in size. I have a custom QwtData to store the values as float instead of double.

    Quite often, the QwtPlotCurve doesn't change once created. How can I override QwtPlot::drawItems(...) to disable the re-plotting of the huge QwtPlotItem when I only changed my custom QwtPlotItems? Thanks.
    TNG

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

    Default Re: How to temporarily disable a redraw of one of the curves

    A paint event clears the canvas and repaints it completely. So you can't skip painting of an item.

    What you can do is to render your curve to a image with a transparent background, or to introduce a paint cache ( pixmap ) for items with z values below a certain limit.

    Uwe

  3. #3
    Join Date
    Jan 2009
    Posts
    47
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to temporarily disable a redraw of one of the curves

    Could you elaborate on the two options, perhaps with some code snippet? Thanks.
    TNG

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.