Return correct width for minimum and preferred size.

BUG:212341

svn path=/trunk/KDE/kdelibs/; revision=1042611
This commit is contained in:
Petri Damstén 2009-10-30 10:11:12 +00:00
parent 22c6e31931
commit d03a3ef5df

View File

@ -269,6 +269,10 @@ QSizeF Frame::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const
d->svg->getMargins(left, top, right, bottom);
hint.setHeight(fm.height() + top + bottom);
if (which == Qt::MinimumSize || which == Qt::PreferredSize) {
QRectF rect = fm.boundingRect(d->text);
hint.setWidth(rect.width() + left + right);
}
}
return hint;