summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-03-19 16:16:12 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-05-11 14:51:41 (GMT)
commit0fde21aa44289f367f11e79500310a54db1787bb (patch)
treec61197900018d7d510d89b3096838e8dbe1f3e04
parentc24887401cf7e22825263e8b50d37ef704a2f90d (diff)
downloadQt-0fde21aa44289f367f11e79500310a54db1787bb.zip
Qt-0fde21aa44289f367f11e79500310a54db1787bb.tar.gz
Qt-0fde21aa44289f367f11e79500310a54db1787bb.tar.bz2
Added coordinate translation for points inside gesture event when
propagating event.
-rw-r--r--src/gui/kernel/qgesture.h1
-rw-r--r--src/gui/kernel/qgesturemanager.cpp7
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;
}