##// 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 m_SelectionZones.append(m_DrawingZone);
125 m_SelectionZones.append(m_DrawingZone);
126 }
126 }
127 else {
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 plot.replot(QCustomPlot::rpQueuedReplot);
131 plot.replot(QCustomPlot::rpQueuedReplot);
@@ -169,6 +169,7 VisualizationGraphWidget::VisualizationGraphWidget(const QString &name, QWidget
169 // - zoom is enabled
169 // - zoom is enabled
170 // - Mouse wheel on qcpplot is intercepted to determine the zoom orientation
170 // - Mouse wheel on qcpplot is intercepted to determine the zoom orientation
171 ui->widget->setInteractions(QCP::iRangeZoom | QCP::iSelectItems);
171 ui->widget->setInteractions(QCP::iRangeZoom | QCP::iSelectItems);
172 ui->widget->axisRect()->setRangeDrag(Qt::Horizontal | Qt::Vertical);
172
173
173 // The delegate must be initialized after the ui as it uses the plot
174 // The delegate must be initialized after the ui as it uses the plot
174 impl->m_RenderingDelegate = std::make_unique<VisualizationGraphRenderingDelegate>(*this);
175 impl->m_RenderingDelegate = std::make_unique<VisualizationGraphRenderingDelegate>(*this);
@@ -653,6 +654,9 void VisualizationGraphWidget::onMousePress(QMouseEvent *event) noexcept
653 impl->startDrawingZone(event->pos(), plot());
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 // Allows mouse panning only in default mode
661 // Allows mouse panning only in default mode
658 plot().setInteraction(QCP::iRangeDrag, sqpApp->plotsInteractionMode()
662 plot().setInteraction(QCP::iRangeDrag, sqpApp->plotsInteractionMode()
General Comments 0
You need to be logged in to leave comments. Login now