QCustomPlot Discussion and Comments

deselect with keyboard modifierReturn to overview

I have a plot with m_plot->setInteractions(QCP::iSelectPlottables | QCP::iMultiSelect); and m_plot->setSelectionRectMode(QCP::srmSelect); set on it. Also in this plot, every graph is "multiple data ranges" selectable, m_plot->graph(i)->setSelectable(QCP::stMultipleDataRanges);
I know that I can use Ctrl (by default) to multi-select graph(s), that's OK and great. But how can I deselect part of selected graph(s) with another modifier key (e.g. Shift)? (preferably, actually).
Now, when I hold down Ctrl and select a region that is totally inside a selected region, it gets deselected, but when regions overlap, it selects and unions both regions.

I think it's hard.
But you can subclass QCustomPlot and reimplement QCustomPlot::processRectSelection to determine the actual selection or deselection.
Hope that can help you.

I think that's exactly what I want, Thanks.
But processRectSelection code is very complicated for me :D
I try to read it multiple times to understand what to do.

I copy-paste the code inside processRectSelection method from QCustomPlot class into my derived class, but it has errors:
error: ‘virtual QCP::Interaction QCPLayerable::selectionCategory() const’ is protected within this context
error: ‘virtual void QCPLayerable::deselectEvent(bool*)’ is protected within this context

emmmm... only modify the source code...

I think, it's because QCP is friend of some other classes.
BTW thanks, I'll modify the source code