summaryrefslogtreecommitdiff
path: root/tests
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 /tests
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 'tests')
-rw-r--r--tests/auto/controls/data/tst_spinbox.qml38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_spinbox.qml b/tests/auto/controls/data/tst_spinbox.qml
index 587d2be0..d42a2551 100644
--- a/tests/auto/controls/data/tst_spinbox.qml
+++ b/tests/auto/controls/data/tst_spinbox.qml
@@ -49,6 +49,7 @@
****************************************************************************/
import QtQuick 2.2
+import QtQuick.Controls 1.2
import QtQuick.Controls.Private 1.0
import QtTest 1.0
@@ -702,6 +703,43 @@ Item {
test.destroy()
}
+
+ Component {
+ id: moveMouseFlickable
+ Flickable {
+ property alias spinbox: _spinbox
+ width: 100
+ height: 200
+ contentHeight: 500
+ contentWidth: 200
+ SpinBox {
+ id: _spinbox
+ x: 20
+ y: 100
+ minimumValue: 0
+ maximumValue: 12500
+ }
+ }
+ }
+
+ function test_moveMouseInFlickable() {
+ var control = createTemporaryObject(moveMouseFlickable, container)
+ var spinbox = control.spinbox
+ spinbox.forceActiveFocus()
+ setCoordinates(spinbox)
+ mousePress(spinbox, upCoord.x, upCoord.y, Qt.LeftButton)
+ mouseMove(spinbox.parent, mainCoord.x, mainCoord.y - 50, 500)
+ compare(spinbox.hovered, false)
+ compare(spinbox.__styleData.upHovered, false)
+ compare(spinbox.__styleData.downHovered, false)
+ mouseRelease(spinbox.parent, mainCoord.x, mainCoord.y - 50, Qt.LeftButton)
+ var currentVal = spinbox.value
+ mouseMove(spinbox.parent, upCoord.x, upCoord.y)
+ compare(spinbox.hovered, true)
+ compare(spinbox.__styleData.upHovered, true)
+ compare(spinbox.__styleData.downHovered, false)
+ compare(spinbox.value, currentVal)
+ }
}
}