ok, I removed the QString::number(myPlot.ValueAt(pos.x(), pos.y())
{
public:
{
setRubberBandPen
(QColor(Qt
::green));
//d_picker->setRubberBand(QwtPicker::PolygonRubberBand);
//setTrackerPen(QColor(Qt::yellow));
//setTrackerFont(f);
}
QwtText trackerText
(const QwtDoublePoint
& pos
) const;
};
QwtText PlotPicker
::trackerText (const QwtDoublePoint
& pos
) const {
bgColor.setAlpha(160);
text.
setBackgroundBrush(QBrush(bgColor
));
return text;
}
class PlotPicker : public QwtPlotPicker
{
public:
PlotPicker(QwtPlot::Axis xAxis, QwtPlot::Axis yAxis, QwtPicker::RubberBand rb, QwtPicker::DisplayMode dm, QwtPlotCanvas* canvas):
QwtPlotPicker( xAxis, yAxis, rb , dm , canvas)
{
setStateMachine(new QwtPickerPolygonMachine());
setRubberBandPen(QColor(Qt::green));
//d_picker->setRubberBand(QwtPicker::PolygonRubberBand);
//setTrackerPen(QColor(Qt::yellow));
//setTrackerFont(f);
}
QwtText trackerText (const QwtDoublePoint & pos) const;
};
QwtText PlotPicker::trackerText (const QwtDoublePoint & pos) const
{
QwtText text("(" + QString::number(pos.x()) + "...," + QString::number(pos.y()) + ") " );
QColor bgColor(Qt::blue);
bgColor.setAlpha(160);
text.setBackgroundBrush(QBrush(bgColor));
return text;
}
To copy to clipboard, switch view to plain text mode
but the function trackerText is never actually called. I changed several parameters (colour, text, etc) but nothing happens!
Bookmarks