aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_splitview.qml
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-12-30 11:44:50 +0100
committerLiang Qi <liang.qi@qt.io>2019-12-30 11:44:50 +0100
commitec686af14f817cc51323cfb01186f036905789c3 (patch)
tree29d229c8df8f37db56b9f6f5f3997bcd732689d4 /tests/auto/controls/data/tst_splitview.qml
parent0425562e14e41b62dc7631c7c02768b8294454d0 (diff)
parent090eab86b05478572485b3086c087a846fbae7fd (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts: .qmake.conf tests/auto/controls/data/tst_combobox.qml Change-Id: I8471cdac4397f77a8e58140d58c6b50d3c437928
Diffstat (limited to 'tests/auto/controls/data/tst_splitview.qml')
-rw-r--r--tests/auto/controls/data/tst_splitview.qml51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_splitview.qml b/tests/auto/controls/data/tst_splitview.qml
index c125b99e..74e4c68e 100644
--- a/tests/auto/controls/data/tst_splitview.qml
+++ b/tests/auto/controls/data/tst_splitview.qml
@@ -2026,4 +2026,55 @@ TestCase {
compare(control.repeater.count, 3)
compare(control.contentChildren.length, 3)
}
+
+ Component {
+ id: hoverableChildrenSplitViewComponent
+
+ SplitView {
+ handle: handleComponent
+ anchors.fill: parent
+
+ MouseArea {
+ objectName: "mouseArea1"
+ hoverEnabled: true
+
+ SplitView.preferredWidth: 200
+ }
+ MouseArea {
+ objectName: "mouseArea2"
+ hoverEnabled: true
+ }
+ }
+ }
+
+ function test_hoverableChilden() {
+ if (Qt.platform.pluginName === "offscreen" || Qt.platform.pluginName === "minimal")
+ skip("Mouse hovering not functional on offscreen/minimal platforms")
+
+ var control = createTemporaryObject(hoverableChildrenSplitViewComponent, testCase)
+ verify(control)
+
+ verify(isPolishScheduled(control))
+ verify(waitForItemPolished(control))
+
+ // Move the mouse over the handle.
+ var handles = findHandles(control)
+ var targetHandle = handles[0]
+ // Test fails if we don't do two moves for some reason...
+ mouseMove(targetHandle, targetHandle.width / 2, targetHandle.height / 2)
+ mouseMove(targetHandle, targetHandle.width / 2, targetHandle.height / 2)
+ verify(targetHandle.SplitHandle.hovered)
+
+ // Move the mouse to the MouseArea on the left. The handle should no longer be hovered.
+ mouseMove(control, 100, control.height / 2)
+ verify(!targetHandle.SplitHandle.hovered)
+
+ // Move the mouse back over the handle.
+ mouseMove(targetHandle, targetHandle.width / 2, targetHandle.height / 2)
+ verify(targetHandle.SplitHandle.hovered)
+
+ // Move the mouse to the MouseArea on the right. The handle should no longer be hovered.
+ mouseMove(control, control.width - 100, control.height / 2)
+ verify(!targetHandle.SplitHandle.hovered)
+ }
}