summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicslayout.h
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2011-02-09 15:07:24 +0100
committerThierry Bastian <thierry.bastian@nokia.com>2011-05-12 15:47:26 +0200
commit913ff732004c2c61c39bcdd82ff05ea1827f328b (patch)
tree7e0b50b23cabaf3643fd64806e8ab6577e7e86d5 /src/gui/graphicsview/qgraphicslayout.h
parent1ce725cb60358a31b1107ab5c892abb7ceca8453 (diff)
Avoid flicker when invalidate is propagated in a widget/layout hierarchy
* Do not call invalidate from activateRecursive(). This resulted in that a layout was invalidated as many times as there were items in the layout. * Several improvements. Do not call resize(size()) too often. Calling resize() from the widgetEvent() is not very nice though... * Remove commented out code * make sure layout is activated even if the widget does not change size * activate the layout if the resize is same as size() * In order to not break existing apps, make this an opt-in feature with QGraphicsLayout::setInstantInvalidatePropagation(true); Reviewed-by: Frederik Gladhorn Reviewed-by: John Tapsell
Diffstat (limited to 'src/gui/graphicsview/qgraphicslayout.h')
-rw-r--r--src/gui/graphicsview/qgraphicslayout.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicslayout.h b/src/gui/graphicsview/qgraphicslayout.h
index c622fb881e..60311744a2 100644
--- a/src/gui/graphicsview/qgraphicslayout.h
+++ b/src/gui/graphicsview/qgraphicslayout.h
@@ -76,6 +76,8 @@ public:
virtual QGraphicsLayoutItem *itemAt(int i) const = 0;
virtual void removeAt(int index) = 0;
+ static void setInstantInvalidatePropagation(bool enable);
+ static bool instantInvalidatePropagation();
protected:
QGraphicsLayout(QGraphicsLayoutPrivate &, QGraphicsLayoutItem *);
void addChildLayoutItem(QGraphicsLayoutItem *layoutItem);