summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2017-11-30 10:48:18 +0100
committerAndy Shaw <andy.shaw@qt.io>2018-04-17 09:06:20 +0000
commit0689a8256c0a21087c01fff3998fd3b606a5ac4c (patch)
tree06fc65bac9ec9570513b7f52b0028e4cc3e81691 /src
parent71beceb772dedfcaa30eda8ce2ed146e835b59f9 (diff)
downloadqtquickcontrols-0689a8256c0a21087c01fff3998fd3b606a5ac4c.tar.gz
Slider: don't break the binding on value when using the mouse wheel
When the wheel was used it could cause any binding on value to be broken since it was updated directly. Going via range.position ensures this is not the case. Change-Id: Ic041ea911cee68de34f5c4e184cf8460f5e002da Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/controls/Slider.qml4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/controls/Slider.qml b/src/controls/Slider.qml
index e290640e..07ad74c4 100644
--- a/src/controls/Slider.qml
+++ b/src/controls/Slider.qml
@@ -331,14 +331,14 @@ Control {
onVerticalWheelMoved: {
if (verticalDelta !== 0) {
var delta = Math.abs(verticalDelta)*step > stepSize ? verticalDelta*step : verticalDelta/Math.abs(verticalDelta)*stepSize
- value -= delta * (inverted ? 1 : -1)
+ range.position = range.positionForValue(value - delta * (inverted ? 1 : -1))
}
}
onHorizontalWheelMoved: {
if (horizontalDelta !== 0) {
var delta = Math.abs(horizontalDelta)*step > stepSize ? horizontalDelta*step : horizontalDelta/Math.abs(horizontalDelta)*stepSize
- value += delta * (inverted ? 1 : -1)
+ range.position = range.positionForValue(value + delta * (inverted ? 1 : -1))
}
}
}