Hi,
if I use a QCPGraph with setSelectable(QCP::stDataRange); and afterwards submit an empty selection, I get errors on the console:
double QCPAbstractPlottable1D<DataType>::dataMainValue(int) const [with DataType = QCPGraphData] Index out of bounds -1
double QCPAbstractPlottable1D<DataType>::dataMainKey(int) const [with DataType = QCPGraphData] Index out of bounds -1
I guess the reason is, that QCPDataSelection::enforceType(QCP::SelectionType type) generates a strange QCPDataSelection([0..-1]) via the span() method.
The following code demonstrates the error.
int main(int argc, char *argv[]) { QCPDataSelection selection; qDebug() << selection; qDebug() << selection.span(); selection.enforceType(QCP::stDataRange); qDebug() << selection; }
This results in:
QCPDataSelection()
[0..-1]
QCPDataSelection([0..-1] )
This is at least not what I would expect...
Best,
Olaf