Hey everybody,
after a few days working at it, i have found one solution for my problem.
I will list some things quickly!
-first you have to add an QwtPlotPicker to your QwtPlot
@QwtPlotPicker *picker = new QwtPlotPicker(ui->qwtPlot->xBottom, ui->qwtPlot->yLeft, QwtPicker::NoRubberBand, QwtPicker::AlwaysOn, ui->qwtPlot->canvas());@
-than u declare a QwtPickerMachine(ClickPoint or Drag Point)
@QwtPickerMachine* pickerMachine = new QwtPickerDragPointMachine();@
-set the PickerMachine to your Picker
@picker->setStateMachine(pickerMachine);@
-connect picker Signal with a Slot
@connect(picker,SIGNAL(moved(QPoint)),this,SLOT(function(QPoint)));@
-your slot function should look like this
@void function(QPoint actualMousePosition){
int x = myCurve->closestPoint(actualMousePosition,
NULL);
QPointF Position = myCurve->sample(x);
Marker->setValue(Position);
ui->qwtPlot->replot();@
Be sure u declared a QwtPlotMarker before using the function. The Function closestPoint() is very importend.
I hope i could give u an idea how to use this things, if u have questions write me a private message!