diff options
Diffstat (limited to 'src/quicktemplates2/qquickdrawer.cpp')
-rw-r--r-- | src/quicktemplates2/qquickdrawer.cpp | 39 |
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); |