diff options
-rw-r--r-- | src/gui/kernel/qgesture.h | 1 | ||||
-rw-r--r-- | src/gui/kernel/qgesturemanager.cpp | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h index 9f58f7a..f98b573 100644 --- a/src/gui/kernel/qgesture.h +++ b/src/gui/kernel/qgesture.h @@ -99,6 +99,7 @@ protected: virtual void translate(const QPoint &offset); private: + friend class QGestureManager; friend class QGestureRecognizerPan; friend class QDoubleTapGestureRecognizer; friend class QTapAndHoldGestureRecognizer; diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index 97f73b2..173b1a0 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -409,8 +409,13 @@ bool QGestureManager::sendGestureEvent(QWidget *receiver, QGestureEvent *event) foreach(const QString &gesture, event->gestureTypes()) eventGestures << qHash(gesture); - while (receiver && (receiver->d_func()->gestures & eventGestures).isEmpty()) + QPoint offset; + while (receiver && (receiver->d_func()->gestures & eventGestures).isEmpty()) { + offset += receiver->pos(); receiver = receiver->parentWidget(); + } + foreach(QGesture *gesture, event->gestures()) + gesture->translate(offset); return receiver ? qt_sendSpontaneousEvent(receiver, event) : false; } |