fatecasino
24th April 2015, 03:06
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());
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&)));
Implementing the SLOT
void my2dPlot::onContinuumAreaSelected(const QRectF& selectedRect)
{
...
float w = QwtPlotPicker::invTransform(selectedRect.bottomRig ht()).x();
....
}
I get the error:
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
Any ideas?
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());
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&)));
Implementing the SLOT
void my2dPlot::onContinuumAreaSelected(const QRectF& selectedRect)
{
...
float w = QwtPlotPicker::invTransform(selectedRect.bottomRig ht()).x();
....
}
I get the error:
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
Any ideas?