Hello,
I have integrated the spectrogram example into my programm and it also works fine. Then I wanted to start adapting it for my purposes and made the member variable "d_spectrogram;" public:
#include <qwt_plot.h>
#include <qwt_plot_spectrogram.h>
{
Q_OBJECT
public:
QwtPlotSpectrogram *d_spectrogram;
// define it as public to be able to access it from another class
public slots:
void showContour(bool on);
void showSpectrogram(bool on);
void printPlot();
private:
//QwtPlotSpectrogram *d_spectrogram;
};
#include <qwt_plot.h>
#include <qwt_plot_spectrogram.h>
class Plot: public QwtPlot
{
Q_OBJECT
public:
Plot(QWidget * = NULL);
QwtPlotSpectrogram *d_spectrogram; // define it as public to be able to access it from another class
public slots:
void showContour(bool on);
void showSpectrogram(bool on);
void printPlot();
private:
//QwtPlotSpectrogram *d_spectrogram;
};
To copy to clipboard, switch view to plain text mode
I also have outsourced the class "class SpectrogramData: public QwtRasterData" from plot.cpp to my class and let it plot by:
d_plot->d_spectrogram->setData(SpectrogramData());
d_plot->showContour(true);
d_plot->d_spectrogram->setData(SpectrogramData());
d_plot->showContour(true);
To copy to clipboard, switch view to plain text mode
It works, but as soon as I drag a rectangle to zoom in, the whole plot disappears and appears again if I click on right mouse button to zoom out. It appears however not in the right position but the left bottom corner of the plot is in the middle of the plot widget ( see attached image). Anyway the plot can be dragged correctly and if I drag now a new rectangle to zoom in, then it works correctly. Only the right mouse button and the first zoom in don't work properly. Why?
Thank you.
best regards,
Vitali
Bookmarks