diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-07-04 15:14:23 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-07-04 18:05:34 +0000 |
commit | cce7cae5e464a34ecbacfa90f601a9b1dad712c3 (patch) | |
tree | 286826c7d8252ac0092cc082026e59872b919edd /tests | |
parent | af74ca8e0ccf0fc59d6e918c679fcc5139aab59d (diff) |
BusyIndicator: 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: I195d5ec3122ca0c7f2fade700b5b0c221472a243
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_busyindicator.qml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_busyindicator.qml b/tests/auto/controls/data/tst_busyindicator.qml index 77a2d5ba..3de8c795 100644 --- a/tests/auto/controls/data/tst_busyindicator.qml +++ b/tests/auto/controls/data/tst_busyindicator.qml @@ -65,6 +65,11 @@ TestCase { BusyIndicator { } } + Component { + id: mouseArea + MouseArea { } + } + function test_running() { var control = createTemporaryObject(busyIndicator, testCase) verify(control) @@ -73,4 +78,26 @@ TestCase { control.running = false compare(control.running, false) } + + // QTBUG-61785 + function test_mouseArea() { + var ma = createTemporaryObject(mouseArea, testCase, {width: testCase.width, height: testCase.height}) + verify(ma) + + var control = busyIndicator.createObject(ma, {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) + } } |