Hi,
I just switched from QCP 1.3.1 to 2.0.0-beta and I really like the new features and the new data containers. Thanks a lot for the great work!
Something I was missing when porting to 2.0.0-beta was a neat way to access the last added data in a QCPGraph. In 1.3.1 I did something like this:
double last_value = qcpgraph->data()->last().value; double last_key = qcpgraph->data()->last().key;
which I found intuitive and compatible with other Qt containers. Now in 2.0.0 I could only come up with a solution like this:
double last_value = qcpgraph->dataMainValue(qcpgraph->dataCount()-1); double last_key = qcpgraph->dataMainKey(qcpgraph->dataCount()-1);
which of course works fine but its just not as neat as it was before. Is there a better way to do this which I have overlooked?
Otherwise, I would like to suggest to add QCPDataContainer::last(), such that one could do this:
double last_value = qcpgraph->data().data()->last().value; double last_key = qcpgraph->data().data()->last().key;
Thanks!
Roland