aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickdrawer.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-06-01 21:38:16 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-06-07 09:56:45 +0000
commit038d5651940cfcd9fad017e6a4df00389b997da3 (patch)
tree302f8ff40155c31b00f9eaf1dcdb6188ae160f48 /src/quicktemplates2/qquickdrawer.cpp
parenta4a570e813c72e308dd0897bcf256d19fee471a3 (diff)
Let users disable the multi-touch support
The newly added multi-touch support can create issues, especially together with Flickable that is unfortunately still not properly touch-compatible. The implementation is still based on synthesized mouse events, so things like Flickable::pressDelay that intercepts mouse presses and re-sends sends them after a delay, does not play well with touch-enabled controls. The easiest way we can disable the whole thing is to make multi- touch support a configurable feature, the same way hover support is. ./configure -no-feature-quicktemplates2-multitouch [...] Qt Quick Templates 2: Hover support .......................... yes Multi-touch support .................... no [ChangeLog][Templates] Added a configure feature for disabling multi- touch support (configure -no-feature-quicktemplates2-multitouch). Task-number: QTBUG-61144 Change-Id: I0003ae925c2a499ecb3e2a5b720088bd963d9ad3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickdrawer.cpp')
-rw-r--r--src/quicktemplates2/qquickdrawer.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickdrawer.cpp b/src/quicktemplates2/qquickdrawer.cpp
index 8159f05e..66c84ea2 100644
--- a/src/quicktemplates2/qquickdrawer.cpp
+++ b/src/quicktemplates2/qquickdrawer.cpp
@@ -278,6 +278,7 @@ bool QQuickDrawerPrivate::startDrag(QEvent *event)
}
break;
+#if QT_CONFIG(quicktemplates2_multitouch)
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
for (const QTouchEvent::TouchPoint &point : static_cast<QTouchEvent *>(event)->touchPoints()) {
@@ -288,6 +289,7 @@ bool QQuickDrawerPrivate::startDrag(QEvent *event)
}
}
break;
+#endif
default:
break;
@@ -340,6 +342,7 @@ bool QQuickDrawerPrivate::grabMouse(QQuickItem *item, QMouseEvent *event)
return overThreshold;
}
+#if QT_CONFIG(quicktemplates2_multitouch)
bool QQuickDrawerPrivate::grabTouch(QQuickItem *item, QTouchEvent *event)
{
Q_Q(QQuickDrawer);
@@ -385,6 +388,7 @@ bool QQuickDrawerPrivate::grabTouch(QQuickItem *item, QTouchEvent *event)
return overThreshold;
}
+#endif
static const qreal openCloseVelocityThreshold = 300;
@@ -672,8 +676,10 @@ bool QQuickDrawer::childMouseEventFilter(QQuickItem *child, QEvent *event)
{
Q_D(QQuickDrawer);
switch (event->type()) {
+#if QT_CONFIG(quicktemplates2_multitouch)
case QEvent::TouchUpdate:
return d->grabTouch(child, static_cast<QTouchEvent *>(event));
+#endif
case QEvent::MouseMove:
return d->grabMouse(child, static_cast<QMouseEvent *>(event));
case QEvent::MouseButtonPress:
@@ -695,8 +701,10 @@ bool QQuickDrawer::overlayEvent(QQuickItem *item, QEvent *event)
{
Q_D(QQuickDrawer);
switch (event->type()) {
+#if QT_CONFIG(quicktemplates2_multitouch)
case QEvent::TouchUpdate:
return d->grabTouch(item, static_cast<QTouchEvent *>(event));
+#endif
case QEvent::MouseMove:
return d->grabMouse(item, static_cast<QMouseEvent *>(event));
default:
@@ -705,11 +713,13 @@ bool QQuickDrawer::overlayEvent(QQuickItem *item, QEvent *event)
return QQuickPopup::overlayEvent(item, event);
}
+#if QT_CONFIG(quicktemplates2_multitouch)
void QQuickDrawer::touchEvent(QTouchEvent *event)
{
Q_D(QQuickDrawer);
d->grabTouch(d->popupItem, event);
}
+#endif
void QQuickDrawer::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
{