I'm very confused about these two functions (findBegin and findEnd) when using Qcustomplot, the description of these two functions is the same, but the arguments of findBegin and findEnd are true or false, I tested with the following code:
double xCoord = xAxis->pixelToCoord(event->pos().x());
QCPDataContainer<QCPGraphData>::const_iterator coorPointL =
graph(0)->data().data()->findBegin(xCoord, true);
QCPDataContainer<QCPGraphData>::const_iterator coorPointR =
graph(0)->data().data()->findBegin(xCoord, false);
QCPDataContainer<QCPGraphData>::const_iterator coorPointL1 =
graph(0)->data().data()->findEnd(xCoord, true);
QCPDataContainer<QCPGraphData>::const_iterator coorPointR1 =
graph(0)->data().data()->findBegin(xCoord, false);
qDebug() << "be L=" << coorPointL->key;
qDebug() << "be R=" << coorPointR->key;
qDebug() << "End L=" << coorPointL1->key;
qDebug() << "End R=" << coorPointR1->key;
qDebug() << "val=" << xCoord;
This is the output:
be L= 0.62
be R= 0.64
End L= 0.66
End R= 0.64
val= 0.629841
My questions are: 1. What is the difference between findBegin(xCoord, false) and findBegin(xCoord, false) when the findEnd function has different parameters? The value they get is the same
2. findBegin(xCoord, true)What is the function of this function in this case?