##// END OF EJS Templates
Enables drag only for x-axis
Alexandre Leroux -
r167:c5551b90ffe8
parent child
Show More
@@ -30,9 +30,10 VisualizationGraphWidget::VisualizationGraphWidget(QWidget *parent)
30 ui->setupUi(this);
30 ui->setupUi(this);
31
31
32 // Set qcpplot properties :
32 // Set qcpplot properties :
33 // - Drag and zoom are enabled
33 // - Drag (on x-axis) and zoom are enabled
34 // - Mouse wheel on qcpplot is intercepted to determine the zoom orientation
34 // - Mouse wheel on qcpplot is intercepted to determine the zoom orientation
35 ui->widget->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
35 ui->widget->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
36 ui->widget->axisRect()->setRangeDrag(Qt::Horizontal);
36 connect(ui->widget, &QCustomPlot::mouseWheel, this, &VisualizationGraphWidget::onMouseWheel);
37 connect(ui->widget, &QCustomPlot::mouseWheel, this, &VisualizationGraphWidget::onMouseWheel);
37 }
38 }
38
39
General Comments 0
You need to be logged in to leave comments. Login now