summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2009-09-04 10:30:02 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2009-09-04 13:20:06 (GMT)
commita0b5f9529f3bb7858f4261af98aa13d20ac6c16c (patch)
tree3b1cbe7e5d0e3de471175039dba9944711a314e2
parent55bda33db049d137f4a1e3349e40e8d3365748c6 (diff)
downloadQt-a0b5f9529f3bb7858f4261af98aa13d20ac6c16c.zip
Qt-a0b5f9529f3bb7858f4261af98aa13d20ac6c16c.tar.gz
Qt-a0b5f9529f3bb7858f4261af98aa13d20ac6c16c.tar.bz2
QGraphicsWidget::sizeHint didn't pass the correct constraint to layout.
Adjust the constraint with the widget margin before passing it on to d->layout->effectiveSizeHint().
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index afabf49..d0f3b99 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -687,11 +687,13 @@ QSizeF QGraphicsWidget::sizeHint(Qt::SizeHint which, const QSizeF &constraint) c
Q_D(const QGraphicsWidget);
QSizeF sh;
if (d->layout) {
- sh = d->layout->effectiveSizeHint(which, constraint);
+ QSizeF marginSize(0,0);
if (d->margins) {
- sh += QSizeF(d->margins[d->Left] + d->margins[d->Right],
+ marginSize = QSizeF(d->margins[d->Left] + d->margins[d->Right],
d->margins[d->Top] + d->margins[d->Bottom]);
}
+ sh = d->layout->effectiveSizeHint(which, constraint - marginSize);
+ sh += marginSize;
} else {
switch (which) {
case Qt::MinimumSize: