Hi,
I am new to C++ and QT, I am trying to use qwt plot picker with invTrasform, but I cannot manage it. User draws a rectangular with the mouse on the plot and I try to get the actual x,y coordinates.
I created a plot picker:
picker = new PlotPicker(QwtPlot::xBottom, QwtPlot::yLeft,QwtPicker::RectRubberBand, QwtPicker::AlwaysOn, myPlot->canvas());
To copy to clipboard, switch view to plain text mode
I am trying to get the coordinates from a QRect that the user draws with mouse
connect(continuum_picker, SIGNAL(selected(QRectF&)), this, SLOT(onContinuumAreaSelected(const QRectF&)));
connect(continuum_picker, SIGNAL(selected(QRectF&)), this, SLOT(onContinuumAreaSelected(const QRectF&)));
To copy to clipboard, switch view to plain text mode
Implementing the SLOT
void my2dPlot::onContinuumAreaSelected(const QRectF& selectedRect)
{
...
float w
= QwtPlotPicker::invTransform(selectedRect.
bottomRight()).
x();
....
}
void my2dPlot::onContinuumAreaSelected(const QRectF& selectedRect)
{
...
float w = QwtPlotPicker::invTransform(selectedRect.bottomRight()).x();
....
}
To copy to clipboard, switch view to plain text mode
I get the error:
error: no matching function for call to 'PlotPicker::invTransform(QPointF)'
error: no matching function for call to 'PlotPicker::invTransform(QPointF)'
candidates are: QRectF QwtPlotPicker::invTransform(const QRect&) const
note: QPointF QwtPlotPicker::invTransform(const QPoint&) const
To copy to clipboard, switch view to plain text mode
Any ideas?
Bookmarks