From 6b3b47539967722ee18d072c004e96ba1acb3234 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Tue, 28 Feb 2012 17:29:40 +1000 Subject: Update item position in parent change atomically. Changing x and y individually generates two geometry changed events, the first of which has an invalid position as the x coordinate is relative to the new parent and the y relative to the old parent. This in turn causes the Drag item to send move events with incorrect positions. Task-number: QTBUG-24534 Change-Id: If2636a968acc0fffce21d1a7e51510426ace38a0 Reviewed-by: Michael Brasser --- src/quick/items/qquickstateoperations.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/quick/items/qquickstateoperations.cpp b/src/quick/items/qquickstateoperations.cpp index c4dd0fd146..ca2a94716a 100644 --- a/src/quick/items/qquickstateoperations.cpp +++ b/src/quick/items/qquickstateoperations.cpp @@ -132,8 +132,7 @@ void QQuickParentChangePrivate::doChange(QQuickItem *targetParent, QQuickItem *s if (ok) { //qDebug() << x << y << rotation << scale; - target->setX(x); - target->setY(y); + target->setPos(QPointF(x, y)); target->setRotation(target->rotation() + rotation); target->setScale(target->scale() * scale); } -- cgit v1.2.3