diff options
-rw-r--r-- | src/quicktemplates2/qquickbusyindicator.cpp | 7 | ||||
-rw-r--r-- | src/quicktemplates2/qquickbusyindicator_p.h | 4 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_busyindicator.qml | 27 |
3 files changed, 38 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickbusyindicator.cpp b/src/quicktemplates2/qquickbusyindicator.cpp index 883066d7..e4f20d83 100644 --- a/src/quicktemplates2/qquickbusyindicator.cpp +++ b/src/quicktemplates2/qquickbusyindicator.cpp @@ -115,6 +115,13 @@ void QQuickBusyIndicator::setRunning(bool running) emit runningChanged(); } +#if QT_CONFIG(quicktemplates2_multitouch) +void QQuickBusyIndicator::touchEvent(QTouchEvent *event) +{ + event->ignore(); // QTBUG-61785 +} +#endif + #if QT_CONFIG(accessibility) QAccessible::Role QQuickBusyIndicator::accessibleRole() const { diff --git a/src/quicktemplates2/qquickbusyindicator_p.h b/src/quicktemplates2/qquickbusyindicator_p.h index 3607cc1f..f140764b 100644 --- a/src/quicktemplates2/qquickbusyindicator_p.h +++ b/src/quicktemplates2/qquickbusyindicator_p.h @@ -69,6 +69,10 @@ Q_SIGNALS: void runningChanged(); protected: +#if QT_CONFIG(quicktemplates2_multitouch) + void touchEvent(QTouchEvent *event) override; +#endif + #if QT_CONFIG(accessibility) QAccessible::Role accessibleRole() const override; #endif 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) + } } |