Hello,
I have posted a lot and I got a lot of help here. I need another one. I'm plotting graphs with dotted line and tracking using QwtPlotPicker, but it tracks the plot area and I would like to track only some selected points. My code to track the whole area is:
plot->canvas());
picker
->setRubberBandPen
(QColor(Qt
::darkMagenta));
picker
->setRubberBand
(QwtPicker::CrossRubberBand);
picker
->setTrackerPen
(QColor(Qt
::green));
picker = new QwtPlotPicker(QwtPlot::xBottom, channelSelection->currentIndex(),
QwtPlotPicker::CrossRubberBand, QwtPicker::AlwaysOn,
plot->canvas());
picker->setStateMachine(new QwtPickerDragPointMachine());
picker->setRubberBandPen(QColor(Qt::darkMagenta));
picker->setRubberBand(QwtPicker::CrossRubberBand);
picker->setTrackerPen(QColor(Qt::green));
To copy to clipboard, switch view to plain text mode
As I said, this code tracks the whole plotting area and I want to track just some points that I have saved in my QVector. For example, the draw below is showing the picker tracking some part of the plotting area and showing the x and y axis value:
trackNow.jpg
And I would like to show the value according by the points that I have, the tracking would show something just when the mouse is on the place that the point is equal to some point of my vector. I have the line and the dots, the dots are my values, when the user pass the mouse on a dot the picker would show the value:
rightTrack.jpg
Is it possible to enable the picker just for some points? If yes, someone can help me giving me a tipp, I have no idea how to set the picker to track just some selected points.
Thanks in advance
Best Regards
Bookmarks