aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickoverlay.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-24 03:03:50 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-24 03:03:51 +0200
commit5182f7c5a3190231d1431258ea4cfcd26fbeb2b0 (patch)
tree940e9d6d4a59d3e79a50200d34bfd43fa41e93dc /src/quicktemplates2/qquickoverlay.cpp
parent0cab878ae937451c8b53262cde7a05e7feaec0a6 (diff)
parent6815f353e5a73c0dcf39fbfc91c6a2c1b0784324 (diff)
Merge remote-tracking branch 'origin/5.13' into 5.14
Diffstat (limited to 'src/quicktemplates2/qquickoverlay.cpp')
-rw-r--r--src/quicktemplates2/qquickoverlay.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/quicktemplates2/qquickoverlay.cpp b/src/quicktemplates2/qquickoverlay.cpp
index cf72c8a6..3f358706 100644
--- a/src/quicktemplates2/qquickoverlay.cpp
+++ b/src/quicktemplates2/qquickoverlay.cpp
@@ -126,11 +126,6 @@ bool QQuickOverlayPrivate::startDrag(QEvent *event, const QPointF &pos)
return false;
}
-static bool isTouchEvent(QEvent *event)
-{
- return event->type() == QEvent::TouchBegin || event->type() == QEvent::TouchUpdate || event->type() == QEvent::TouchEnd;
-}
-
bool QQuickOverlayPrivate::handlePress(QQuickItem *source, QEvent *event, QQuickPopup *target)
{
if (target) {
@@ -139,7 +134,18 @@ bool QQuickOverlayPrivate::handlePress(QQuickItem *source, QEvent *event, QQuick
return true;
}
return false;
- } else if (!mouseGrabberPopup || isTouchEvent(event)) {
+ }
+
+ switch (event->type()) {
+ default: {
+ if (mouseGrabberPopup)
+ break;
+#if QT_CONFIG(quicktemplates2_multitouch)
+ Q_FALLTHROUGH();
+ case QEvent::TouchBegin:
+ case QEvent::TouchUpdate:
+ case QEvent::TouchEnd:
+#endif
// allow non-modal popups to close themselves,
// and non-dimming modal popups to block the event
const auto popups = stackingOrderPopups();
@@ -149,6 +155,8 @@ bool QQuickOverlayPrivate::handlePress(QQuickItem *source, QEvent *event, QQuick
return true;
}
}
+ break;
+ }
}
event->ignore();