I think I managed to create my own class myPicker.


Qt Code:
  1. class myPicker : public QwtPlotPicker
  2. {
  3. public:
  4.  
  5. myPicker(QwtPlot::Axis xAxis, QwtPlot::Axis yAxis, QwtPicker::RubberBand rb, QwtPicker::DisplayMode dm, QwtPlotCanvas* canvas):
  6. QwtPlotPicker( xAxis, yAxis, rb , dm , canvas)
  7. {
  8.  
  9. setStateMachine(new QwtPickerPolygonMachine());
  10. setRubberBandPen(QColor(Qt::green));
  11. //d_picker->setRubberBand(QwtPicker::PolygonRubberBand);
  12. setTrackerPen(QColor(Qt::yellow));
  13. //setTrackerFont(f);
  14.  
  15.  
  16.  
  17. }
  18.  
  19.  
  20. QwtText trackerText (const QwtDoublePoint & pos) const;
  21.  
  22. };
  23.  
  24.  
  25. QwtText myPicker::trackerText (const QwtDoublePoint & pos) const
  26. {
  27. QwtText text("(" + QString::number(pos.x()) + "," + QString::number(pos.y()) + ") ");
  28. QColor bgColor(Qt::black);
  29. bgColor.setAlpha(160);
  30. text.setBackgroundBrush(QBrush(bgColor));
  31. return text;
  32. }
To copy to clipboard, switch view to plain text mode 

and i created my object like this:

Qt Code:
  1. d_picker = new myPicker(QwtPlot::xBottom, QwtPlot::yLeft,
  2. QwtPlotPicker::PolygonRubberBand, QwtPicker::AlwaysOn,
  3. myPlot->canvas());
To copy to clipboard, switch view to plain text mode 

I have two very basic questions..
1.how do i use my new function trackerText (const QwtDoublePoint & pos) const
2.When i use the myPlot private member


Qt Code:
  1. QwtText text("(" + QString::number(pos.x()) + "," + QString::number(pos.y()) + ") " + QString::number(myPlot.ValueAt(pos.x(), pos.y()))); QColor bgColor(Qt::black);
To copy to clipboard, switch view to plain text mode 

i get that myPlot is undeclared. How did FelixB used it with m_spectrogram without getting any error?