summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJarkko T. Toivonen <jarkko.t.toivonen@nokia.com>2011-09-15 12:40:51 (GMT)
committerJarkko T. Toivonen <jarkko.t.toivonen@nokia.com>2011-09-15 12:40:51 (GMT)
commitb0fbf9dae591dc839e14a087c1d69189e3fe9461 (patch)
treeba48dc146d729c0a8a3c26710fd926671254f9dc /src/gui
parente9060024fa2100ce5c8b2e8689d2ec72b75a3211 (diff)
downloadQt-b0fbf9dae591dc839e14a087c1d69189e3fe9461.zip
Qt-b0fbf9dae591dc839e14a087c1d69189e3fe9461.tar.gz
Qt-b0fbf9dae591dc839e14a087c1d69189e3fe9461.tar.bz2
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
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/qlabel.cpp8
1 files changed, 8 insertions, 0 deletions
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 <qaccessible.h>
#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());