##// END OF EJS Templates
Allow graph panning with the mouse in default mode
trabillard -
r1045:26c176b0b338
parent child
Show More
@@ -125,7 +125,7 struct VisualizationGraphWidget::VisualizationGraphWidgetPrivate {
125 125 m_SelectionZones.append(m_DrawingZone);
126 126 }
127 127 else {
128 plot.removeItem(m_DrawingZone); // the item is deleted by QCustomPlot
128 plot.removeItem(m_DrawingZone); // the item is deleted by QCustomPlot
129 129 }
130 130
131 131 plot.replot(QCustomPlot::rpQueuedReplot);
@@ -169,6 +169,7 VisualizationGraphWidget::VisualizationGraphWidget(const QString &name, QWidget
169 169 // - zoom is enabled
170 170 // - Mouse wheel on qcpplot is intercepted to determine the zoom orientation
171 171 ui->widget->setInteractions(QCP::iRangeZoom | QCP::iSelectItems);
172 ui->widget->axisRect()->setRangeDrag(Qt::Horizontal | Qt::Vertical);
172 173
173 174 // The delegate must be initialized after the ui as it uses the plot
174 175 impl->m_RenderingDelegate = std::make_unique<VisualizationGraphRenderingDelegate>(*this);
@@ -653,6 +654,9 void VisualizationGraphWidget::onMousePress(QMouseEvent *event) noexcept
653 654 impl->startDrawingZone(event->pos(), plot());
654 655 }
655 656 }
657 else if (sqpApp->plotsInteractionMode() == SqpApplication::PlotsInteractionMode::None) {
658 plot().setInteraction(QCP::iRangeDrag, true);
659 }
656 660
657 661 // Allows mouse panning only in default mode
658 662 plot().setInteraction(QCP::iRangeDrag, sqpApp->plotsInteractionMode()
General Comments 0
You need to be logged in to leave comments. Login now