diff options
Diffstat (limited to 'tests/auto/controls/data/tst_control.qml')
-rw-r--r-- | tests/auto/controls/data/tst_control.qml | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/tests/auto/controls/data/tst_control.qml b/tests/auto/controls/data/tst_control.qml index 3018498e..1b60eb73 100644 --- a/tests/auto/controls/data/tst_control.qml +++ b/tests/auto/controls/data/tst_control.qml @@ -40,8 +40,8 @@ import QtQuick 2.2 import QtTest 1.0 -import QtQuick.Controls 2.0 -import QtQuick.Templates 2.0 as T +import QtQuick.Controls 2.1 +import QtQuick.Templates 2.1 as T TestCase { id: testCase @@ -859,7 +859,9 @@ TestCase { verify(control) compare(control.hovered, false) - compare(control.hoverEnabled, false) + compare(control.hoverEnabled, Qt.styleHints.useHoverEffects) + + control.hoverEnabled = false mouseMove(control, control.width / 2, control.height / 2) compare(control.hovered, false) @@ -891,6 +893,42 @@ TestCase { control.destroy() } + function test_hoverEnabled() { + var control = component.createObject(testCase) + compare(control.hoverEnabled, Qt.styleHints.useHoverEffects) + + var child = component.createObject(control) + var grandChild = component.createObject(child) + + var childExplicitHoverEnabled = component.createObject(control, {hoverEnabled: true}) + var grandChildExplicitHoverDisabled = component.createObject(childExplicitHoverEnabled, {hoverEnabled: false}) + + var childExplicitHoverDisabled = component.createObject(control, {hoverEnabled: false}) + var grandChildExplicitHoverEnabled = component.createObject(childExplicitHoverDisabled, {hoverEnabled: true}) + + control.hoverEnabled = false + compare(control.hoverEnabled, false) + compare(grandChild.hoverEnabled, false) + + compare(childExplicitHoverEnabled.hoverEnabled, true) + compare(grandChildExplicitHoverDisabled.hoverEnabled, false) + + compare(childExplicitHoverDisabled.hoverEnabled, false) + compare(grandChildExplicitHoverEnabled.hoverEnabled, true) + + control.hoverEnabled = true + compare(control.hoverEnabled, true) + compare(grandChild.hoverEnabled, true) + + compare(childExplicitHoverEnabled.hoverEnabled, true) + compare(grandChildExplicitHoverDisabled.hoverEnabled, false) + + compare(childExplicitHoverDisabled.hoverEnabled, false) + compare(grandChildExplicitHoverEnabled.hoverEnabled, true) + + control.destroy() + } + function test_implicitSize() { var control = component.createObject(testCase) verify(control) |