aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-12-10 16:06:44 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-12-10 21:03:48 +0000
commit9d39a470d1393ab429d03010bedb8cd631457842 (patch)
tree797a8c6ecac5599d1e66ba4b606930311aea66de /tests
parenteba39a3ba543c04747aa837b064a35ea6b32ed89 (diff)
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 <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_pane.qml28
1 files changed, 28 insertions, 0 deletions
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()
+ }
}