diff options
author | John Tapsell <john.tapsell.ext@basyskom.de> | 2010-11-30 10:20:37 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2010-12-03 12:40:00 (GMT) |
commit | c343e2139b1764008b812ee6cc3a2a980fa4d147 (patch) | |
tree | 58de0cdd1012f78b68955351c80cb53fd426704d /src | |
parent | 3f7c80d105d18a3b901a7f3077d8faaea63e0659 (diff) | |
download | Qt-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')
-rw-r--r-- | src/gui/graphicsview/qgraphicslayout.cpp | 7 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicslayoutitem.cpp | 2 |
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; } /*! |