Results 1 to 2 of 2

Thread: Adding points to a plot without forcing a redraw

  1. #1
    Join Date
    Oct 2008
    Location
    Murfreesboro, TN
    Posts
    10
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Windows

    Question Adding points to a plot without forcing a redraw

    I read through the documentation and through the forum and couldn't find anything covering what I am trying to do but I assume it really shouldn't be as hard as I am making it out to be.

    Jists of what I am doing:

    Reading in a file of points and placing a QwtSymbol::Cross at each point. The rendering is being done while reading in the file.

    Issue that is occuring:

    When I go to draw a new QwtSymbol::Cross to the screen it is going back and redrawing every point not just the newest point. I tried "setPaintAttribute(QwtPlotCurve::PaintFiltered );" in hopes to see if that would help in any form of performance. I have overridden the "QwtPlotCurve::draw" and placed all my drawing routines between "painter->save()" and "painter->restore()" in order to try and increase performance but I still haven't found a way to simply only draw the newest points. When I specifically state to only draw the newest points it clears all other points from the screen. Hoping that I am just looking over a quick and easy method to implement this.

    Let me know if you need any more information from me and I will try and give what I can. Thanks for reading this over.

    Thanks,
    Jon

  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: Adding points to a plot without forcing a redraw

    You are looking for QwtPlotCurve::draw(int from, int to). The realtime example shows an use case similar to yours

    But note that with Qt4 the performance of incremental painting depends on the capabilities of your environment. Only when Qt::WA_PaintOutsidePaintEvent is supported it works as effective as with Qt3.

    Uwe

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.