PDA

View Full Version : Please Help-->selecting point from the qwtplot !



Krish
20th March 2008, 12:36
Hello! Friends,
I want to select a point as and when user clicks on the plot.In that i want to get the y-value of curve at that point For which am using QwtPlotPicker class as: -


QwtPlotPicker* picker = new QwtPlotPicker(sampleqwtPlot->canvas);
double pt = curve.y(picker->invTransform(const QPoint& p) const);
yvalueLineEdit->setText(QString::number(pt,10));


But it shows me following error: -

sampleplot.cpp: In member function `void samplePlot::get_point()':
sampleplot.cpp:183: error: no matching function for call to `QwtPlotPicker::QwtP
lotPicker(<unknown type>)'
../../../Qt/qwt-5.0.2/src/qwt_plot_picker.h:30: note: candidates are: QwtPlotPic
ker::QwtPlotPicker(const QwtPlotPicker&)
../../../Qt/qwt-5.0.2/src/qwt_plot_picker.h:41: note: QwtPlotPic
ker::QwtPlotPicker(int, int, int, QwtPicker::RubberBand, QwtPicker::DisplayMode,
QwtPlotCanvas*)
../../../Qt/qwt-5.0.2/src/qwt_plot_picker.h:37: note: QwtPlotPic
ker::QwtPlotPicker(int, int, QwtPlotCanvas*)
../../../Qt/qwt-5.0.2/src/qwt_plot_picker.h:34: note: QwtPlotPic
ker::QwtPlotPicker(QwtPlotCanvas*)


I dont know why its not accepting the given canvas?:confused:

Can anyone please help me out in this?-->I will be thankful.

Uwe
20th March 2008, 19:43
The brackets are missing: new QwtPlotPicker(sampleqwtPlot->canvas() );

Uwe

Krish
25th March 2008, 15:36
Hello! Uwe Sir,
Thanks very much for helping me out. Now i came to know that how do i do such silly mistakes when am too much tensed.

Thanks again & Best Regards:)