summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2018-03-12 12:32:00 +0100
committerAndy Shaw <andy.shaw@qt.io>2018-04-17 06:45:21 +0000
commit71beceb772dedfcaa30eda8ce2ed146e835b59f9 (patch)
tree6a1b8e8202942f28065d9002bf33352657a4884d /src
parent8e71e41bc901beec1aedabe8c9bc6c94df2e295a (diff)
downloadqtquickcontrols-71beceb772dedfcaa30eda8ce2ed146e835b59f9.tar.gz
Stop incrementing if the mouse is no longer over the button
Change-Id: Ibc95b14faaa77f200cf6ea5e05cb227e6a3628ca Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/controls/SpinBox.qml6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/controls/SpinBox.qml b/src/controls/SpinBox.qml
index a742abd6..b7ec6a8f 100644
--- a/src/controls/SpinBox.qml
+++ b/src/controls/SpinBox.qml
@@ -359,8 +359,9 @@ Control {
property bool autoincrement: false;
onReleased: autoincrement = false
+ onExited: autoincrement = false
Timer { running: mouseUp.pressed; interval: 350 ; onTriggered: mouseUp.autoincrement = true }
- Timer { running: mouseUp.autoincrement; interval: 60 ; repeat: true ; onTriggered: __increment() }
+ Timer { running: mouseUp.autoincrement && mouseUp.containsMouse; interval: 60 ; repeat: true ; onTriggered: __increment() }
}
// Spinbox decrement button
@@ -386,8 +387,9 @@ Control {
property bool autoincrement: false;
onReleased: autoincrement = false
+ onExited: autoincrement = false
Timer { running: mouseDown.pressed; interval: 350 ; onTriggered: mouseDown.autoincrement = true }
- Timer { running: mouseDown.autoincrement; interval: 60 ; repeat: true ; onTriggered: __decrement() }
+ Timer { running: mouseDown.autoincrement && mouseDown.containsMouse; interval: 60 ; repeat: true ; onTriggered: __decrement() }
}
Keys.onUpPressed: __increment()