From cce7cae5e464a34ecbacfa90f601a9b1dad712c3 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 4 Jul 2017 15:14:23 +0200 Subject: 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 --- src/quicktemplates2/qquickbusyindicator.cpp | 7 +++++++ src/quicktemplates2/qquickbusyindicator_p.h | 4 ++++ 2 files changed, 11 insertions(+) (limited to 'src') 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 -- cgit v1.2.3