summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2010-04-06 15:04:20 (GMT)
committerGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2010-04-06 15:19:02 (GMT)
commit253b87180e0a6c5db0feaaed7e321139c4ff1643 (patch)
tree43cec5e35132774d451cffb574eddb81fea5c138 /src
parent97f5d3f102c6b3167872c5ab1c6e0a215cb2f1c1 (diff)
downloadQt-253b87180e0a6c5db0feaaed7e321139c4ff1643.zip
Qt-253b87180e0a6c5db0feaaed7e321139c4ff1643.tar.gz
Qt-253b87180e0a6c5db0feaaed7e321139c4ff1643.tar.bz2
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
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 f106b3d..d6daf4d 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -7112,7 +7112,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))));