Results 1 to 10 of 10

Thread: Redrawing a single row of a QwtPlotSpectrogram

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2009
    Posts
    39
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    9

    Default Re: Redrawing a single row of a QwtPlotSpectrogram

    Interesting, never used mutable before but it seems to work fine. However, I bet if my C++ professor were around, I'd probably get a slap on the hand...

  2. #2
    Join Date
    Nov 2009
    Posts
    39
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    9

    Default Re: Redrawing a single row of a QwtPlotSpectrogram

    Got it working!! Very smooth scrolling animation now. Uwe, thanks so much for your help!

  3. #3
    Join Date
    Nov 2009
    Posts
    39
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    9

    Default Re: Redrawing a single row of a QwtPlotSpectrogram

    Although I've achieved my original goal, I'm now looking to generate large plots quicker and more efficiently. How much of a change would be involved to use OpenGL to paint plots instead of QPainter? I'm assuming I'll need to subclass QwtPlot? Uwe, any advice/direction?

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

    Default Re: Redrawing a single row of a QwtPlotSpectrogram

    First of all I would optimize the existing solution and turn all paint caches off, because you have your own image cache:

    a) Spectrogram item
    Qt Code:
    1. spectrogram->setCachePolicy(QwtPlotRasterItem::NoCache);
    To copy to clipboard, switch view to plain text mode 

    b) Plot canvas

    Qt Code:
    1. plot->canvas()->setPaintAttribute(QwtPlotCanvas::PaintCached, false);
    2. plot->canvas()->setPaintAttribute(QwtPlotCanvas::PaintPacked, false);
    To copy to clipboard, switch view to plain text mode 
    c) Qt ( only supported on X11 )

    Qt Code:
    1. plot->canvas()->setAttribute(Qt::WA_PaintOnScreen, true);
    To copy to clipboard, switch view to plain text mode 

    Another optimization on multicore systems is to render parts of the image parallel in several threads.

    Uwe

  5. #5
    Join Date
    Nov 2009
    Posts
    39
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    9

    Default Re: Redrawing a single row of a QwtPlotSpectrogram

    Thanks! I'd already applied a) (the default is NoCache I think). I just applied b), and it sped things up a little. I'm using Windows (unfortunately), so c) doesn't apply.

    For the most part, I'm getting the performance I need, so moving rendering to the GPU isn't absolutely necessary for me. My profiler says that most of the work is being done in qdrawhelper_p in some low-level math functions, so I don't think there's a higher level bottleneck. However, for a 1024x768 canvas, I'd like to be able to do 30 draws a second. Right now I can only get to ~20. (For smaller canvas, I have no problem with 30).

Similar Threads

  1. can a single statement work in signal/slot mechanism
    By salmanmanekia in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2008, 09:24
  2. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 07:13

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
  •  
Qt is a trademark of The Qt Company.