summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2010-12-14 10:46:57 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2010-12-14 11:58:57 (GMT)
commit3778c3f5208f3db99d6b23a2a3c4abf1fe2ec64f (patch)
tree4554fca6763c851ab696ad014396b788ffe3f797 /src
parentd0cf0603fa6f55f7655e5e4b2ea5a2cbc42a39fc (diff)
downloadQt-3778c3f5208f3db99d6b23a2a3c4abf1fe2ec64f.zip
Qt-3778c3f5208f3db99d6b23a2a3c4abf1fe2ec64f.tar.gz
Qt-3778c3f5208f3db99d6b23a2a3c4abf1fe2ec64f.tar.bz2
Make sure that d->init() is called from both ctors.
QGraphicsLayout uses the protected ctor that did not call d->init(), so all its subclasses was potentially suffering from this. Task-number: QTBUG-15333 Reviewed-by: John Tapsell
Diffstat (limited to 'src')
-rw-r--r--src/gui/graphicsview/qgraphicslayoutitem.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicslayoutitem.cpp b/src/gui/graphicsview/qgraphicslayoutitem.cpp
index df13039..b11dc9e 100644
--- a/src/gui/graphicsview/qgraphicslayoutitem.cpp
+++ b/src/gui/graphicsview/qgraphicslayoutitem.cpp
@@ -129,7 +129,6 @@ void QGraphicsLayoutItemPrivate::init()
{
sizeHintCacheDirty = true;
sizeHintWithConstraintCacheDirty = true;
- sizePolicy = QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
}
/*!
@@ -400,6 +399,7 @@ QGraphicsLayoutItem::QGraphicsLayoutItem(QGraphicsLayoutItem *parent, bool isLay
{
Q_D(QGraphicsLayoutItem);
d->init();
+ sizePolicy = QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
d->q_ptr = this;
}
@@ -410,6 +410,7 @@ QGraphicsLayoutItem::QGraphicsLayoutItem(QGraphicsLayoutItemPrivate &dd)
: d_ptr(&dd)
{
Q_D(QGraphicsLayoutItem);
+ d->init();
d->q_ptr = this;
}