got it
I had to write my own subclass of QwtPlotPicker and overriding the "trackerText" method:
{
Q_OBJECT
public:
MyPicker
(int xAxis,
int yAxis,
int selectionFlags, RubberBand rubberBand, DisplayMode trackerMode,
QwtPlotCanvas* canvas
);
signals:
void mouseMoved(const QPoint& pos) const;
protected:
virtual QwtText trackerText
(const QwtDoublePoint
& pos
) const;
};
class MyPicker : public QwtPlotPicker
{
Q_OBJECT
public:
MyPicker(int xAxis, int yAxis, int selectionFlags, RubberBand rubberBand, DisplayMode trackerMode, QwtPlotCanvas* canvas);
signals:
void mouseMoved(const QPoint& pos) const;
protected:
virtual QwtText trackerText (const QwtDoublePoint & pos) const;
};
To copy to clipboard, switch view to plain text mode
MyPicker
::MyPicker(int xAxis,
int yAxis,
int selectionFlags, RubberBand rubberBand, DisplayMode trackerMode,
QwtPlotCanvas* canvas
) : QwtPlotPicker(xAxis, yAxis, selectionFlags, rubberBand, trackerMode, canvas
) {}
QwtText MyPicker
::trackerText (const QwtDoublePoint
& pos
) const {
const QPoint point
= pos.
toPoint();
emit mouseMoved(point);
}
MyPicker::MyPicker(int xAxis, int yAxis, int selectionFlags, RubberBand rubberBand, DisplayMode trackerMode, QwtPlotCanvas* canvas)
: QwtPlotPicker(xAxis, yAxis, selectionFlags, rubberBand, trackerMode, canvas)
{}
QwtText MyPicker::trackerText (const QwtDoublePoint & pos) const
{
const QPoint point = pos.toPoint();
emit mouseMoved(point);
return QwtText(QString::number(point.x()) + ", " + QString::number(point.y()));
}
To copy to clipboard, switch view to plain text mode
now I can react to the "mouseMoved"-signal
Bookmarks