From 4adc57a51851875f9f236d5ec19893ce61990c57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Wed, 27 Jan 2021 10:37:50 +0100 Subject: [PATCH] pid tuning: add mouse wheel zooming --- src/QmlControls/PIDTuning.qml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/QmlControls/PIDTuning.qml b/src/QmlControls/PIDTuning.qml index a498049..064fa76 100644 --- a/src/QmlControls/PIDTuning.qml +++ b/src/QmlControls/PIDTuning.qml @@ -254,6 +254,13 @@ RowLayout { var next = chart.mapToValue(Qt.point(mouse.x+1, mouse.y+1)) _scaling = next.x - start.x } + onWheel: { + if (wheel.angleDelta.y > 0) + chartDisplaySec /= 1.2 + else + chartDisplaySec *= 1.2 + _xAxis.min = _xAxis.max - chartDisplaySec + } onPositionChanged: { if(_startPoint != undefined) { dataTimer.running = false