Спасибо.
Результат
class tQwtPlotPicker: public QwtPlotPicker
{
public:
explicit tQwtPlotPicker( int xAxis, int yAxis, RubberBand rubberBand, DisplayMode trackerMode, QWidget * wgt):QwtPlotPicker(xAxis,yAxis,rubberBand,trackerMode, wgt )
{
}
QPointF retPoint() const
{
return invTransform(trackerPosition() );
}
};
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
tQwtPlotPicker * d_picker1;
...
}
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
...
d_picker1 = new tQwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::CrossRubberBand, QwtPicker::AlwaysOn, plot1->canvas());
d_picker1->setRubberBandPen(QColor(Qt::green));
d_picker1->setRubberBand(QwtPicker::CrossRubberBand);
d_picker1->setTrackerPen(QColor(Qt::black));
}
...
void MainWindow::mousePressEvent(QMouseEvent *event)
{
if (event->buttons() & Qt::RightButton)
{
qDebug()<<d_picker1->retPoint().x();
qDebug()<<d_picker1->retPoint().y();
}
}