aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-07-04 15:18:04 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-07-04 18:05:37 +0000
commit64dd82cdeaf0a6ad10e0fb57a7dabe73ea9cb77e (patch)
tree780e3c0e22cd5cfcbb2e39c92e6a889507f52018 /tests/auto/controls
parentcce7cae5e464a34ecbacfa90f601a9b1dad712c3 (diff)
ScrollIndicator: don't block touch
Unlike with mouse events there's setAcceptedMouseButtons(), currently there's no way to control whether a control receives touch events or not. As a temporary workaround until QQuickItem::setAcceptTouchEvents() has been added, we'll have to ignore touch events by hand. Task-number: QTBUG-61785 Change-Id: I9a678570bfdd104ae32b4040ecef7625dcfd1aee Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/controls')
-rw-r--r--tests/auto/controls/data/tst_scrollindicator.qml27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_scrollindicator.qml b/tests/auto/controls/data/tst_scrollindicator.qml
index 54cd7159..894a035d 100644
--- a/tests/auto/controls/data/tst_scrollindicator.qml
+++ b/tests/auto/controls/data/tst_scrollindicator.qml
@@ -66,6 +66,11 @@ TestCase {
}
Component {
+ id: mouseArea
+ MouseArea { }
+ }
+
+ Component {
id: flickable
Flickable {
width: 100
@@ -217,4 +222,26 @@ TestCase {
compare(horizontal.contentItem.x, horizontal.leftPadding + 0.8 * horizontal.availableWidth)
compare(horizontal.contentItem.width, 0.2 * horizontal.availableWidth)
}
+
+ // QTBUG-61785
+ function test_mouseArea() {
+ var ma = createTemporaryObject(mouseArea, testCase, {width: testCase.width, height: testCase.height})
+ verify(ma)
+
+ var control = scrollIndicator.createObject(ma, {active: true, size: 0.9, width: testCase.width, height: testCase.height})
+ verify(control)
+
+ mousePress(control)
+ verify(ma.pressed)
+
+ mouseRelease(control)
+ verify(!ma.pressed)
+
+ var touch = touchEvent(control)
+ touch.press(0, control).commit()
+ verify(ma.pressed)
+
+ touch.release(0, control).commit()
+ verify(!ma.pressed)
+ }
}