Hello! The plot (QwtPlot) contains many markers (QwtPlotMarker). How to determine which marker was clicked?
To solve this problem, I changed the standard example of "event filter". After each click of the mouse, I check all the markers.
If the marker is located close to the click, this marker has been pressed.
Code:
{ const QwtPlotItemList& items = itemList(); for ( QwtPlotItemIterator i = items.begin(); i != items.end(); ++i ) { { // The distance from the marker to the place a clicked if (distance <= 5) { qDebug() << "YEAP!"; } } } }
Is there a better solution?

