From b038a10d13f942d956956683a7b6c4913e43e426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ho=C3=A0ng=20=C4=90=E1=BB=A9c=20Hi=E1=BA=BFu?= Date: Tue, 16 Oct 2007 11:54:37 +0000 Subject: [PATCH] sizeHint: take alignment and Qt::TextWordWrap flags into account, as done in paintWidget the QRectF is a reasonably large rect so that it doesn't interfere with result size svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=725859 --- widgets/label.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgets/label.cpp b/widgets/label.cpp index 3b1d8382d..9f16f6c7c 100644 --- a/widgets/label.cpp +++ b/widgets/label.cpp @@ -49,7 +49,7 @@ QSizeF Label::sizeHint() const { QFontMetricsF m(QFont("Arial", 12)); - return m.boundingRect(d->text).size(); + return m.boundingRect(QRectF(0,0,9999,9999), d->alignment | Qt::TextWordWrap, d->text).size(); } void Label::setText(const QString& text)