summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2010-04-06 17:04:20 +0200
committerSamuli Piippo <samuli.piippo@digia.com>2011-06-09 13:05:33 +0300
commit9fa3643a4fb707958ea43fda14e6eddc18bc9a1d (patch)
treea0c534e2bdc684da28540c487defa60e000097b2 /src
parent037d7347886dcebff34d9987183623dfeb41861a (diff)
downloadqt4-tools-9fa3643a4fb707958ea43fda14e6eddc18bc9a1d.tar.gz
Moved item wouldn't follow mouse cursor when ItemIgnoresTransformations is set
Since the introduction of transform properties in QGraphicsItem, QGraphicsItem::transform() is no longer enough to get the correct transform of an item. No auto-test as it involves mouse dragging. Reviewed-by: Yoann Task-number: QTBUG-9295 (cherry picked from commit 253b87180e0a6c5db0feaaed7e321139c4ff1643)
Diffstat (limited to 'src')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index b263d63c60..e12ea80a6e 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -6984,7 +6984,8 @@ void QGraphicsItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
// Root items that ignore transformations need to
// calculate their diff by mapping viewport coordinates
// directly to parent coordinates.
- QTransform viewToParentTransform = (item->transform().translate(item->d_ptr->pos.x(), item->d_ptr->pos.y()))
+ // COMBINE
+ QTransform viewToParentTransform = (item->d_func()->transformData->computedFullTransform().translate(item->d_ptr->pos.x(), item->d_ptr->pos.y()))
* (item->sceneTransform() * view->viewportTransform()).inverted();
currentParentPos = viewToParentTransform.map(QPointF(view->mapFromGlobal(event->screenPos())));
buttonDownParentPos = viewToParentTransform.map(QPointF(view->mapFromGlobal(event->buttonDownScreenPos(Qt::LeftButton))));