summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorJohn Tapsell <john.tapsell.ext@basyskom.de>2010-11-30 10:20:37 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2010-12-03 12:40:00 (GMT)
commitc343e2139b1764008b812ee6cc3a2a980fa4d147 (patch)
tree58de0cdd1012f78b68955351c80cb53fd426704d /src/gui/graphicsview
parent3f7c80d105d18a3b901a7f3077d8faaea63e0659 (diff)
downloadQt-c343e2139b1764008b812ee6cc3a2a980fa4d147.zip
Qt-c343e2139b1764008b812ee6cc3a2a980fa4d147.tar.gz
Qt-c343e2139b1764008b812ee6cc3a2a980fa4d147.tar.bz2
QGraphicsLayoutItem - fix invalidating sizehint-with-constraints cache
Reviewed-by: Jan-Arve Sæther
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicslayout.cpp7
-rw-r--r--src/gui/graphicsview/qgraphicslayoutitem.cpp2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicslayout.cpp b/src/gui/graphicsview/qgraphicslayout.cpp
index 86b4589..3e95735 100644
--- a/src/gui/graphicsview/qgraphicslayout.cpp
+++ b/src/gui/graphicsview/qgraphicslayout.cpp
@@ -307,10 +307,13 @@ void QGraphicsLayout::invalidate()
// does not call the base implementation? In addition, updateGeometry()
// does more than we need.
layoutItem->d_func()->sizeHintCacheDirty = true;
- layoutItem = layoutItem->parentLayoutItem();
+ layoutItem->d_func()->sizeHintWithConstraintCacheDirty = true;
+ layoutItem = layoutItem->parentLayoutItem();
}
- if (layoutItem)
+ if (layoutItem) {
layoutItem->d_func()->sizeHintCacheDirty = true;
+ layoutItem->d_func()->sizeHintWithConstraintCacheDirty = true;
+ }
bool postIt = layoutItem ? !layoutItem->isLayout() : false;
if (postIt) {
diff --git a/src/gui/graphicsview/qgraphicslayoutitem.cpp b/src/gui/graphicsview/qgraphicslayoutitem.cpp
index 016cfbf..df13039 100644
--- a/src/gui/graphicsview/qgraphicslayoutitem.cpp
+++ b/src/gui/graphicsview/qgraphicslayoutitem.cpp
@@ -128,6 +128,7 @@ QGraphicsLayoutItemPrivate::~QGraphicsLayoutItemPrivate()
void QGraphicsLayoutItemPrivate::init()
{
sizeHintCacheDirty = true;
+ sizeHintWithConstraintCacheDirty = true;
sizePolicy = QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
}
@@ -828,6 +829,7 @@ void QGraphicsLayoutItem::updateGeometry()
{
Q_D(QGraphicsLayoutItem);
d->sizeHintCacheDirty = true;
+ d->sizeHintWithConstraintCacheDirty = true;
}
/*!