summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem.cpp
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@trolltech.com>2009-03-03 16:08:30 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-04-06 11:49:40 (GMT)
commitd74f1a91b05b943c1a8ae7847de6ee50b2093b89 (patch)
treecb3e96ad861063e4912d9b20555fc6c44fcef59f /src/gui/graphicsview/qgraphicsitem.cpp
parentb67dffcccea9166918ac93c281d87fd5eb3baf84 (diff)
downloadQt-d74f1a91b05b943c1a8ae7847de6ee50b2093b89.zip
Qt-d74f1a91b05b943c1a8ae7847de6ee50b2093b89.tar.gz
Qt-d74f1a91b05b943c1a8ae7847de6ee50b2093b89.tar.bz2
Fixes: Be a bit more smarter when calling setGeometry from itemChange
RevBy: bnilsen AutoTest: Bench Details : if we come from setPosHelper (so itemChange) we don't need to do all the stuff regarding the size in setGeometry because the size doesn't change. I remove two calls to fullUpdateHelper and update() because prepareGeometryChange already call updateHelper and setPosHelper call fullUpdaterHelper too so we don't need to call them inside setGeometry. We can only call prepareGeometryChange only if we don't come from setPos.
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index fa77fd9..443cc8c 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -2352,7 +2352,7 @@ QPointF QGraphicsItem::scenePos() const
the item is also updated; otherwise it is not updated before and after the
change.
*/
-void QGraphicsItemPrivate::setPosHelper(const QPointF &pos, bool update)
+void QGraphicsItemPrivate::setPosHelper(const QPointF &pos)
{
Q_Q(QGraphicsItem);
if (this->pos == pos)
@@ -2364,7 +2364,7 @@ void QGraphicsItemPrivate::setPosHelper(const QPointF &pos, bool update)
return;
// Update and repositition.
- if (scene && update) {
+ if (scene) {
fullUpdateHelper(true);
q->prepareGeometryChange();
}
@@ -2387,7 +2387,7 @@ void QGraphicsItemPrivate::setPosHelper(const QPointF &pos, bool update)
*/
void QGraphicsItem::setPos(const QPointF &pos)
{
- d_ptr->setPosHelper(pos, /* update = */ true);
+ d_ptr->setPosHelper(pos);
}
/*!