Hi,
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
QCustomPlot
code untouched and instead use a class derived from QCPAxisRect
and let my QCustomPlot
instance use it. I couldn't find a method like setAxisRect
though.
How can I achieve this override?