Display the plot values on mouse over. - Detect Scatter points

c++, mouseover, point, qcustomplot, qt

Solution

Reimplement `QCustomPlot::mouseMoveEvent` or connect to `QCustomPlot::mouseMove`.

Then use axes' `coordToPixel` to translate (cursor) pixel coords to plot coords and search nearest points in your `QCPDataMap` with `QMap::lowerBound(cursorX)`.

Problem

I am attempting to display the plot values of different points on my `QCustomPlot` in which I have a Line style of `lsLine`. I know i could set a mouse over signal on the `QCustomPlot` but that wont really help since I just need to be informed when the mouse is over my plotted line.My question is is there any way to find out if the mouse is over my scatter point. Is there a signal i could connect to that would tell me when the mouse is over a scatter point ?

Original source