aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickdrawer.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-04-24 22:06:47 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-04-25 13:27:10 +0000
commitc6151f84a7bd7cadb5f86d58582fb659ce4fae09 (patch)
tree4aee5255ba5a613c9320b6ee66a63a218f333aa6 /src/quicktemplates2/qquickdrawer.cpp
parenta5eee7695ff09338d1481efde268ccdc62cd9143 (diff)
QQuickDrawer: override handlePress/Move/Release/Ungrab()
Change-Id: Id947e868aa1c89aaab0cb6988b76f0cfe25d8339 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickdrawer.cpp')
-rw-r--r--src/quicktemplates2/qquickdrawer.cpp39
1 files changed, 27 insertions, 12 deletions
diff --git a/src/quicktemplates2/qquickdrawer.cpp b/src/quicktemplates2/qquickdrawer.cpp
index 862b36dc..7ecd1558 100644
--- a/src/quicktemplates2/qquickdrawer.cpp
+++ b/src/quicktemplates2/qquickdrawer.cpp
@@ -393,13 +393,36 @@ bool QQuickDrawerPrivate::ungrabMouse(QMouseEvent *event)
return wasGrabbed;
}
-bool QQuickDrawerPrivate::handleMousePressEvent(QQuickItem *item, QMouseEvent *event)
+void QQuickDrawerPrivate::handlePress(const QPointF &point, ulong timestamp)
{
- handlePress(item->mapToScene(event->localPos()), event->timestamp());
+ QQuickPopupPrivate::handlePress(point, timestamp);
offset = 0;
- pressPoint = event->windowPos();
- velocityCalculator.startMeasuring(pressPoint, event->timestamp());
+ pressPoint = point;
+ velocityCalculator.startMeasuring(point, timestamp);
+}
+
+void QQuickDrawerPrivate::handleMove(const QPointF &point, ulong timestamp)
+{
+ QQuickPopupPrivate::handleMove(point, timestamp);
+}
+
+void QQuickDrawerPrivate::handleRelease(const QPointF &point, ulong timestamp)
+{
+ QQuickPopupPrivate::handleRelease(point, timestamp);
+}
+
+void QQuickDrawerPrivate::handleUngrab()
+{
+ QQuickPopupPrivate::handleUngrab();
+
+ pressPoint = QPoint();
+ velocityCalculator.reset();
+}
+
+bool QQuickDrawerPrivate::handleMousePressEvent(QQuickItem *item, QMouseEvent *event)
+{
+ handlePress(item->mapToScene(event->localPos()), event->timestamp());
// don't block press events
// a) outside a non-modal drawer,
@@ -668,14 +691,6 @@ void QQuickDrawer::mouseReleaseEvent(QMouseEvent *event)
d->handleMouseReleaseEvent(d->popupItem, event);
}
-void QQuickDrawer::mouseUngrabEvent()
-{
- Q_D(QQuickDrawer);
- QQuickPopup::mouseUngrabEvent();
- d->pressPoint = QPoint();
- d->velocityCalculator.reset();
-}
-
bool QQuickDrawer::overlayEvent(QQuickItem *item, QEvent *event)
{
Q_D(QQuickDrawer);