Results 1 to 2 of 2

Thread: QwtSpectrogram, don't draw from scratch

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2017
    Posts
    7
    Thanks
    5
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default QwtSpectrogram, don't draw from scratch

    I want to draw a spectrogram periodically, which means that data come over time, and i just want to add columns to the previous graph (see photo).

    What i did is to declare a
    Qt Code:
    1. QwtPlotSpectrogram * spectrogram
    To copy to clipboard, switch view to plain text mode 
    instance, and i use the setData() function where i pass a SpectrogramData instance:

    Qt Code:
    1. class SpectrogramData : public QwtRasterData {
    2.  
    3. private:
    4. std::vector<std::vector<double>> data;
    5.  
    6. public:
    7. SpectrogramData(int height, int width);
    8.  
    9. ~SpectrogramData();
    10.  
    11. virtual double value(double x, double y) const;
    12. };
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. spectrogram->setData(spectrogram_data);
    To copy to clipboard, switch view to plain text mode 

    When new data come, i add them to the data structure, and call replot() in the QwtPlot instance that the QwtSpectrogram is attached to.

    Because the spectrogram will ultimately have about 700*22000 size, i don't know what replot() does. Is there a way to tell qwt to only plot a certain column of data or region or rectangular or something in the spectrogram?
    Attached Images Attached Images
    Last edited by kkaz; 31st July 2017 at 09:19.

Similar Threads

  1. How to adddata for qwtspectrogram
    By centroid in forum Qwt
    Replies: 2
    Last Post: 2nd August 2010, 14:36
  2. Getting started from scratch
    By hyde in forum Newbie
    Replies: 1
    Last Post: 11th December 2008, 15:22
  3. Replies: 0
    Last Post: 28th August 2008, 15:49
  4. QwtSpectrogram example program
    By cgifford in forum Qwt
    Replies: 3
    Last Post: 2nd July 2008, 07:46

Tags for this Thread

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.