diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-02-25 15:48:33 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-03-01 12:28:52 (GMT) |
commit | 9fe43ff4e313220a1ecb02a990324cb6b768e585 (patch) | |
tree | c64a6d40bc78e486b21f00820e1ccf8fda770f95 /src | |
parent | 57686d28fed85c9f8fbb340cd05f3fb6322332f7 (diff) | |
download | Qt-9fe43ff4e313220a1ecb02a990324cb6b768e585.zip Qt-9fe43ff4e313220a1ecb02a990324cb6b768e585.tar.gz Qt-9fe43ff4e313220a1ecb02a990324cb6b768e585.tar.bz2 |
Fixed coordinate system conversion for gestures.
When converting hotspot position (which is in global coordinates) to graphics
scene coordinates we should use the viewport because the mapToScene() takes a
position in a viewport.
Task-number: related to QTBUG-6876
Reviewed-by: Thomas Zander
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 365afdd..a72761a 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5972,12 +5972,12 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event) QList<QGesture *> allGestures = event->gestures(); DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:" - << "Delivering gestures:" << allGestures; + << "Gestures:" << allGestures; QSet<QGesture *> startedGestures; - QPoint delta = graphicsView->mapFromGlobal(QPoint()); - QTransform toScene = QTransform::fromTranslate(delta.x(), delta.y()) - * graphicsView->viewportTransform().inverted(); + QPoint delta = viewport->mapFromGlobal(QPoint()); + QTransform toScene = QTransform::fromTranslate(delta.x(), delta.y()) + * graphicsView->viewportTransform().inverted(); foreach (QGesture *gesture, allGestures) { // cache scene coordinates of the hot spot if (gesture->hasHotSpot()) { |