aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickpageindicator.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-07-04 15:08:51 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-07-04 18:05:32 +0000
commitaf74ca8e0ccf0fc59d6e918c679fcc5139aab59d (patch)
tree10f939131d484203a91f6ae3116b357afa9f215b /src/quicktemplates2/qquickpageindicator.cpp
parent26d528f6b5c61ab5003e97989693851bb6964be4 (diff)
PageIndicator: don't block touch when non-interactive
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: I8e3bdc3df1c3b28afaf8f80965569135e6a53120 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickpageindicator.cpp')
-rw-r--r--src/quicktemplates2/qquickpageindicator.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickpageindicator.cpp b/src/quicktemplates2/qquickpageindicator.cpp
index 7387b019..8f9c8525 100644
--- a/src/quicktemplates2/qquickpageindicator.cpp
+++ b/src/quicktemplates2/qquickpageindicator.cpp
@@ -335,6 +335,17 @@ void QQuickPageIndicator::contentItemChange(QQuickItem *newItem, QQuickItem *old
QQuickItemPrivate::get(newItem)->addItemChangeListener(d, QQuickItemPrivate::Children);
}
+#if QT_CONFIG(quicktemplates2_multitouch)
+void QQuickPageIndicator::touchEvent(QTouchEvent *event)
+{
+ Q_D(QQuickPageIndicator);
+ if (d->interactive)
+ QQuickControl::touchEvent(event);
+ else
+ event->ignore(); // QTBUG-61785
+}
+#endif
+
#if QT_CONFIG(accessibility)
QAccessible::Role QQuickPageIndicator::accessibleRole() const
{