summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Erik Nilsen <bjorn.nilsen@nokia.com>2009-03-25 12:41:10 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-04-06 11:49:48 (GMT)
commita914eb155e085ba0efa5b95154bf7345d4be7cd7 (patch)
treef4b6b3cf37eaa3a17a5d941fabbf713c8c06556a
parent9ed299a3edba92791e1c5af64b8fd9c9fe74c0ea (diff)
downloadQt-a914eb155e085ba0efa5b95154bf7345d4be7cd7.zip
Qt-a914eb155e085ba0efa5b95154bf7345d4be7cd7.tar.gz
Qt-a914eb155e085ba0efa5b95154bf7345d4be7cd7.tar.bz2
Fixes: Minimize QVariant constr/destr in setPosHelper.
RevBy: TrustMe
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index a5d6021..396fdbd 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -2363,7 +2363,8 @@ void QGraphicsItemPrivate::setPosHelper(const QPointF &pos)
return;
// Notify the item that the position is changing.
- QPointF newPos = q->itemChange(QGraphicsItem::ItemPositionChange, pos).toPointF();
+ const QVariant newPosVariant(q->itemChange(QGraphicsItem::ItemPositionChange, pos));
+ QPointF newPos = newPosVariant.toPointF();
if (newPos == this->pos)
return;
@@ -2378,7 +2379,7 @@ void QGraphicsItemPrivate::setPosHelper(const QPointF &pos)
invalidateSceneTransformCache();
// Send post-notification.
- q->itemChange(QGraphicsItem::ItemPositionHasChanged, newPos);
+ q->itemChange(QGraphicsItem::ItemPositionHasChanged, newPosVariant);
inSetPosHelper = 0;
}