summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2009-08-21 12:36:35 (GMT)
committerBenjamin Poulain <benjamin.poulain@nokia.com>2009-08-21 12:41:24 (GMT)
commitf31a7b2d7f08c39dbe2e987ec53bff56ca89c3d1 (patch)
tree8e51f6d77a638e72443634cfe22ea2dfe9644266
parent7023e7f95bdbc0a3c6923336c846f06a7b16e6fa (diff)
downloadQt-f31a7b2d7f08c39dbe2e987ec53bff56ca89c3d1.zip
Qt-f31a7b2d7f08c39dbe2e987ec53bff56ca89c3d1.tar.gz
Qt-f31a7b2d7f08c39dbe2e987ec53bff56ca89c3d1.tar.bz2
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 80acab7..208c4af 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;