Results 1 to 3 of 3

Thread: QwtSpectrogram contour ON a bit slow

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QwtSpectrogram contour ON a bit slow

    Hello,

    I am using QwtPlotSpectrogram with contour mode on and QwtPicker in a Plot. I noticed that when I have my contour ON my picker (showing tracker text) is slow compare to contour mode OFF. It seems like "drawing the contour lines" is called many times even my data has not changed at all. I believe QwtPicker is using some sort of qwtoverlay widget to minimize redrawing.

    Now, Did I miss any cache setting for Contour mode? How can I make my picker as responsive as contour mode OFF in my spectrogram?

    baray98

  2. #2
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtSpectrogram contour ON a bit slow

    Quote Originally Posted by baray98 View Post
    Hello,

    I am using QwtPlotSpectrogram with contour mode on and QwtPicker in a Plot. I noticed that when I have my contour ON my picker (showing tracker text) is slow compare to contour mode OFF. It seems like "drawing the contour lines" is called many times even my data has not changed at all. I believe QwtPicker is using some sort of qwtoverlay widget to minimize redrawing.

    Now, Did I miss any cache setting for Contour mode? How can I make my picker as responsive as contour mode OFF in my spectrogram?

    baray98
    My hunch was right about my problem QwtRasterData::contourLines was called many times when my picker is enabled. Thus producing a performance hit. So my quick solution is to override contourLines and make a cache out from the rect and levels.
    Qt Code:
    1. QwtRasterData::ContourLines Raster2D::contourLines(
    2. const QRectF &rect, const QSize &raster,
    3. const QList<double> &levels, ConrecFlags flags ) const override
    4. {
    5. if (p_data->m_contourRect == rect && p_data->m_contourLevels == levels)
    6. return p_data->m_contourLinesCache;
    7.  
    8. p_data->m_contourRect = rect;
    9. p_data->m_contourLevels = levels;
    10. p_data->m_contourLinesCache = QwtRasterData::contourLines(rect,raster,levels,flags);
    11.  
    12. return p_data->m_contourLinesCache;
    13. }
    To copy to clipboard, switch view to plain text mode 

    things are quick and fast again.
    baray98

  3. #3
    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: QwtSpectrogram contour ON a bit slow

    There is no reason, why the plot should run into updates only because of using a picker ?

    Uwe

Similar Threads

  1. Replies: 1
    Last Post: 2nd August 2017, 16:03
  2. updating waterfall QwtSpectrogram
    By tnorthardt in forum Newbie
    Replies: 2
    Last Post: 2nd November 2012, 15:59
  3. Contour correction
    By jwxiang in forum Qwt
    Replies: 2
    Last Post: 20th July 2012, 14:40
  4. How to adddata for qwtspectrogram
    By centroid in forum Qwt
    Replies: 2
    Last Post: 2nd August 2010, 14:36
  5. QwtSpectrogram example program
    By cgifford in forum Qwt
    Replies: 3
    Last Post: 2nd July 2008, 07:46

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.