If someone else has the same problem as me:
If you use a Statistical Plot (BoxPlot) and have selections on this does not work if the min and max values of the plot are equal. You will never hit the exact spot you need with the mouse.
A quick workaround is to replace
if (QCPRange(mMinimum, mMaximum).contains(posValue)) return qAbs(mKeyAxis.data()->coordToPixel(mKey)-mKeyAxis.data()->coordToPixel(posKey));
at line 18225 in qcustomplot.cpp (Single file version) with
if (mMinimum == mMaximum) { if (QCPRange(mMinimum*0.95, mMaximum*1.05).contains(posValue)) return qAbs(mKeyAxis.data()->coordToPixel(mKey)-mKeyAxis.data()->coordToPixel(posKey)); } else { if (QCPRange(mMinimum, mMaximum).contains(posValue)) return qAbs(mKeyAxis.data()->coordToPixel(mKey)-mKeyAxis.data()->coordToPixel(posKey)); }
This is in the method 'QCPStatisticalBox::selectTest'.
Maybe this helps someone. The correct solution would probably be to take the selection tolerance into acount when doing the whisker test (the thing I changed).