Hello!

I'm trying to place a QwtPlot with QwtPlotSpectrogram on the QGraphicsView.

I took the standard example "spectrogram", adapted it for my needs. And my spectrogram successfully draws on QGraphicsView with QGraphicsScene, but one thing doesn't work well.

There is class MyZoomer in the example:

Qt Code:
  1. class MyZoomer: public QwtPlotZoomer
  2. {
  3. public:
  4. MyZoomer(QwtPlotCanvas *canvas):
  5. QwtPlotZoomer(canvas)
  6. {
  7. setTrackerMode(AlwaysOn);
  8. }
  9.  
  10. virtual QwtText trackerText(const QwtDoublePoint &pos) const
  11. {
  12. QColor bg(Qt::white);
  13. bg.setAlpha(200);
  14.  
  15. QwtText text = QwtPlotZoomer::trackerText(pos);
  16. text.setBackgroundBrush( QBrush( bg ));
  17. return text;
  18. }
  19. };
To copy to clipboard, switch view to plain text mode 

I made no changes in it, but it doesn't work when I place QwtPlot on the QGraphicsView.

I create Plot in the following way:

Qt Code:
  1. Plot* plot = new Plot(NULL, data, QCoreApplication::translate("QFrame", "Grid plot"));
To copy to clipboard, switch view to plain text mode 

And first parameter is the parent. It's null because:

1. If I pass my QGraphicsView* view I will get error (cannot convert from QGraphicsView to QWidget).
2. If I pass the main window pointer QwtPlot won't be showed at all.

I suppose this is the reason why zooming doesn't work.

What should I do?

Thanks a lot.