I have a graph on which I want to enable both left-click range dragging and rubberband selection.
This does not seem possible by default, so I tried the following approach:
Only drag the range if the axis (here I only allow X range dragging) is selected. The following modification to the
mousePressEvent method of
QCPAxisRect seems to work to achieve this:
if ((event->buttons() & Qt::LeftButton) && mParentPlot->xAxis->selectedParts().testFlag(QCPAxis::spAxis))
However, I don't want to leave the
QCustomPlotcode untouched and instead use a class derived from
QCPAxisRectand let my
QCustomPlotinstance use it. I couldn't find a method like
How can I achieve this override?