Do not call setSizePolicy from ctor, it might call a virtual function

More specifically, it might very well call updateGeometry()

Reviewed-by: Frederik Gladhorn
(cherry picked from commit febdcef08f22310cbd70ec13b315f70ff8e41e83)
This commit is contained in:
Jan-Arve Sæther 2011-02-15 13:40:32 +01:00 committed by Olivier Goffart
parent 2e768aad98
commit b46d7d3b91

View File

@ -167,7 +167,7 @@ QGraphicsLayout::QGraphicsLayout(QGraphicsLayoutItem *parent)
" neither a QGraphicsWidget nor QGraphicsLayout");
}
}
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding, QSizePolicy::DefaultType);
d_func()->sizePolicy = QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding, QSizePolicy::DefaultType);
setOwnedByLayout(true);
}
@ -188,7 +188,7 @@ QGraphicsLayout::QGraphicsLayout(QGraphicsLayoutPrivate &dd, QGraphicsLayoutItem
" neither a QGraphicsWidget nor QGraphicsLayout");
}
}
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding, QSizePolicy::DefaultType);
d_func()->sizePolicy = QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding, QSizePolicy::DefaultType);
setOwnedByLayout(true);
}