diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-02-23 16:10:16 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-02-25 08:35:48 +0000 |
commit | 718f6def0b2c4d84bdc8ebdc9633697885747feb (patch) | |
tree | 3d74569c992ccc40860f2cc5d914930a053da231 /tests/auto/controls/data/tst_control.qml | |
parent | d0ab538c1ffadecfe0aa7130918726de7126dd16 (diff) |
Control: add hoverEnabled and hovered properties
Change-Id: I35946b9f13ef78ce7bdfbad9706de3e96bd48ea4
Task-number: QTBUG-50003
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto/controls/data/tst_control.qml')
-rw-r--r-- | tests/auto/controls/data/tst_control.qml | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_control.qml b/tests/auto/controls/data/tst_control.qml index 4ac88687..9d63f429 100644 --- a/tests/auto/controls/data/tst_control.qml +++ b/tests/auto/controls/data/tst_control.qml @@ -894,4 +894,25 @@ TestCase { control.destroy() } + + function test_hover() { + var control = component.createObject(testCase, {width: 100, height: 100}) + verify(control) + + compare(control.hovered, false) + compare(control.hoverEnabled, false) + + mouseMove(control, control.width / 2, control.height / 2) + compare(control.hovered, false) + + control.hoverEnabled = true + + mouseMove(control, control.width / 2, control.height / 2) + compare(control.hovered, true) + + mouseMove(control, -10, -10) + compare(control.hovered, false) + + control.destroy() + } } |