From 9d39a470d1393ab429d03010bedb8cd631457842 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 10 Dec 2015 16:06:44 +0100 Subject: Pane: don't let presses leak through A regression introduced by 38c47c0. Pane is the base type for Frame, GroupBox, and ToolBar. These type of containers shouldn't let presses through. For example, an application that has a listview scrolled below a toolbar, list items under the toolbar should not react when interacting with the toolbar. Change-Id: I7668452fe2d6d89372f032220fa5623b50d334bb Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_pane.qml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tests/auto/controls') diff --git a/tests/auto/controls/data/tst_pane.qml b/tests/auto/controls/data/tst_pane.qml index bf79644a..18fd1cf0 100644 --- a/tests/auto/controls/data/tst_pane.qml +++ b/tests/auto/controls/data/tst_pane.qml @@ -79,6 +79,19 @@ TestCase { } } + Component { + id: pressPane + MouseArea { + width: 200 + height: 200 + property int pressCount + onPressed: ++pressCount + Pane { + anchors.fill: parent + } + } + } + function test_empty() { var control = pane.createObject(testCase) verify(control) @@ -113,4 +126,19 @@ TestCase { control.destroy() } + + function test_press() { + var control = pressPane.createObject(testCase) + verify(control) + + compare(control.pressCount, 0) + mouseClick(control) + compare(control.pressCount, 0) + + control.children[0].enabled = false + mouseClick(control) + compare(control.pressCount, 1) + + control.destroy() + } } -- cgit v1.2.3