From b0fbf9dae591dc839e14a087c1d69189e3fe9461 Mon Sep 17 00:00:00 2001 From: "Jarkko T. Toivonen" Date: Thu, 15 Sep 2011 15:40:51 +0300 Subject: Fix the incorrect sizeHint given by QLabel on Symbian Using the S60 clientRect width in the QLabel size hint calculation (instead of assuming that 80 characters will fit on one line). Task-number: QTBUG-14318 Reviewed-by: Murray Read --- src/gui/widgets/qlabel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp index ab88f38..c0be3e1 100644 --- a/src/gui/widgets/qlabel.cpp +++ b/src/gui/widgets/qlabel.cpp @@ -59,6 +59,10 @@ #include #endif +#ifdef Q_OS_SYMBIAN +#include "qt_s60_p.h" +#endif + QT_BEGIN_NAMESPACE /*! @@ -698,7 +702,11 @@ QSize QLabelPrivate::sizeForWidth(int w) const bool tryWidth = (w < 0) && (align & Qt::TextWordWrap); if (tryWidth) +#ifdef Q_OS_SYMBIAN + w = qMin(S60->clientRect().Width(), q->maximumSize().width()); +#else w = qMin(fm.averageCharWidth() * 80, q->maximumSize().width()); +#endif else if (w < 0) w = 2000; w -= (hextra + contentsMargin.width()); -- cgit v0.12