summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2009-08-21 14:36:35 +0200
committerBenjamin Poulain <benjamin.poulain@nokia.com>2009-08-21 14:41:24 +0200
commitf31a7b2d7f08c39dbe2e987ec53bff56ca89c3d1 (patch)
tree8e51f6d77a638e72443634cfe22ea2dfe9644266
parent7023e7f95bdbc0a3c6923336c846f06a7b16e6fa (diff)
Fix the size returned by QCommonStylePrivate::viewItemSize() for text
The size of the text, computed in qreal, was rounded. If the decimal part of the size was < 0.5, a pixel was missing in the size returned. Reviewed-by: Samuel Rødal Reviewed-by: Olivier Goffart
-rw-r--r--src/gui/styles/qcommonstyle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp
index 80acab7dc..208c4afbe 100644
--- a/src/gui/styles/qcommonstyle.cpp
+++ b/src/gui/styles/qcommonstyle.cpp
@@ -1047,7 +1047,7 @@ QSize QCommonStylePrivate::viewItemSize(const QStyleOptionViewItemV4 *option, in
widthUsed = qMax(widthUsed, line.naturalTextWidth());
}
textLayout.endLayout();
- const QSize size = QSizeF(widthUsed, height).toSize();
+ const QSize size(qCeil(widthUsed), qCeil(height));
return QSize(size.width() + 2 * textMargin, size.height());
}
break;