aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_spinbox.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/controls/data/tst_spinbox.qml')
-rw-r--r--tests/auto/controls/data/tst_spinbox.qml31
1 files changed, 30 insertions, 1 deletions
diff --git a/tests/auto/controls/data/tst_spinbox.qml b/tests/auto/controls/data/tst_spinbox.qml
index a62128d2..30db246f 100644
--- a/tests/auto/controls/data/tst_spinbox.qml
+++ b/tests/auto/controls/data/tst_spinbox.qml
@@ -40,7 +40,7 @@
import QtQuick 2.2
import QtTest 1.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
TestCase {
id: testCase
@@ -460,6 +460,35 @@ TestCase {
control.destroy()
}
+ function test_hover_data() {
+ return [
+ { tag: "up:true", button: "up", hoverEnabled: true, value: 50 },
+ { tag: "up:false", button: "up", hoverEnabled: false, value: 50 },
+ { tag: "up:max", button: "up", hoverEnabled: true, value: 99 },
+ { tag: "down:true", button: "down", hoverEnabled: true, value: 50 },
+ { tag: "down:false", button: "down", hoverEnabled: false, value: 50 },
+ { tag: "down:min", button: "down", hoverEnabled: true, value: 0 }
+ ]
+ }
+
+ function test_hover(data) {
+ var control = spinBox.createObject(testCase, {hoverEnabled: data.hoverEnabled, value: data.value})
+ verify(control)
+
+ var button = control[data.button]
+ compare(control.hovered, false)
+ compare(button.hovered, false)
+
+ mouseMove(control, button.indicator.x + button.indicator.width / 2, button.indicator.y + button.indicator.height / 2)
+ compare(control.hovered, data.hoverEnabled)
+ compare(button.hovered, data.hoverEnabled && button.indicator.enabled)
+
+ mouseMove(control, button.indicator.x - 1, button.indicator.y - 1)
+ compare(button.hovered, false)
+
+ control.destroy()
+ }
+
function test_valueFromText_data() {
return [
{ tag: "editable", editable: true },