diff -r ef0373b55136 -r 758a864f9613 src/gui/graphicsview/qgraphicsgridlayout.cpp --- a/src/gui/graphicsview/qgraphicsgridlayout.cpp Fri Sep 17 08:34:18 2010 +0300 +++ b/src/gui/graphicsview/qgraphicsgridlayout.cpp Mon Oct 04 01:19:32 2010 +0300 @@ -641,7 +641,8 @@ Q_D(const QGraphicsGridLayout); qreal left, top, right, bottom; getContentsMargins(&left, &top, &right, &bottom); - return d->engine.sizeHint(d->styleInfo(), which , constraint) + QSizeF(left + right, top + bottom); + const QSizeF extraMargins(left + right, top + bottom); + return d->engine.sizeHint(d->styleInfo(), which , constraint - extraMargins) + extraMargins; }