QCustomPlot Discussion and Comments

Problem is selection mechanismReturn to overview

Hi,
I used to use QCP 1, I upgraded to QCP 2 and find myself unable to select a graph. With QCP1 I have just to retrieve a pointer to QCPGraph and call setSelected(). But this function disappeared in QCP 2! I found some topics in this forum on the subject but they incomprehensible to me. I **just want to select a graph**. Would someone be kind enough to give me the **simplest** code to do so? My basic usage is: I have several graphs plotted on the same axis, and I want to move selection from one to another by, say, pressing the TAB key.
Many thanks for any help.
JC

You can make the whole plottable appear selected when any point is selected with graph->setSelectable(QCP::stWhole)
and then select any point, perhaps the first one:
graph->setSelection(QCPDataRange(0, 1))
or all of the points (doesn't matter in appearance in stWhole mode):
graph->setSelection(graph->data()->dataRange())