QCustomPlot Discussion and Comments

select multiple graphs verticallyReturn to overview

Hi.
I have multiple line graphs that stacked above eachother, something like https://www.qcustomplot.com/images/examples/scatterstyledemo.png
I enabled selection and multiple selection with setInteractions(QCP::iSelectPlottables | QCP::iMultiSelect) and setSelectionRectMode(QCP::srmSelect);
But I want to select all graphs by mouse dragging, at the same time. actually I want vertical lines instead of a rectangle for selection. How can I do this? I think subclassing QCPSelectionRect will do it but I don't know how.

1. get current mouse pos
2. pixelToCoords for each qcpgraph
3. use qcpgraph's findBegin find data index
4. check index inside datas

Thanks
I know how to programmatically select them all, more or less :)
But I want to implement UI part for this feature

Ok,
you can use QCPItemLine to implement a vertical line

or you can set QCPSelectionRect's top and bottom to QCPAxisRect's top and bottom, width to 1.0

Thanks, that's a good idea