Qt 6.11 is out! See what's new in the release
blog
QwtPlotSpectrogram, don't draw from scratch!
-
I want to draw a spectrogram periodically, which means that data come over time, and i want to just add columns to the previous graph.
What i did is to declare a
QwtPlotSpectrogram * spectrograminstance, and i use thesetData()function where i pass aSpectrogramDatainstance:class SpectrogramData : public QwtRasterData { private: std::vector<std::vector<double>> data; public: SpectrogramData(int height, int width); ~SpectrogramData(); virtual double value(double x, double y) const; };spectrogram->setData(spectrogram_data);When new data come, i add them to the
datastructure, and callreplot()in theQwtPlotinstance that theQwtSpectrogramis attached to.Because the spectrogram will ultimately have about 700*22000 size, i don't know what does
replot()do. Is there a way to tell qwt to only plot a certain column of data or region or rectangular or something? -
Hi,
That's a question you should ask to the Qwt authors.