diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2010-05-05 04:57:26 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2010-05-05 23:44:28 (GMT) |
commit | 3c4d3a65bbce6b1f9e649412f141ee8890a7b6cd (patch) | |
tree | 801be34e129444e7f7c908b31ef27462637342a2 /src/gui/graphicsview/qgraphicsitem.cpp | |
parent | b7513f4a15ecac1adf54f2abdda6b56c89d6bef4 (diff) | |
download | Qt-3c4d3a65bbce6b1f9e649412f141ee8890a7b6cd.zip Qt-3c4d3a65bbce6b1f9e649412f141ee8890a7b6cd.tar.gz Qt-3c4d3a65bbce6b1f9e649412f141ee8890a7b6cd.tar.bz2 |
QGraphicsWidget was not working properly when ItemSendsPositionChanges is false
The geometry was not properly set because QGraphicsWidget rely on itemChange
to update its own geometry. Now when calling setPos we also ensure that
for a widget the geometry will be up to date. Setting the flag
ItemSendsPositionChanges to false for a given widget will give a small
performance boost.
Reviewed-by:janarve
Reviewed-by:bnilsen
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 42abe59..074e571 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -3578,6 +3578,8 @@ void QGraphicsItem::setPos(const QPointF &pos) // Update and repositition. if (!(d_ptr->flags & ItemSendsGeometryChanges)) { d_ptr->setPosHelper(pos); + if (d_ptr->isWidget) + static_cast<QGraphicsWidget *>(this)->d_func()->setGeometryFromSetPos(); return; } |