summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@nokia.com>2011-07-14 09:15:55 (GMT)
committerLiang Qi <liang.qi@nokia.com>2011-07-14 09:15:55 (GMT)
commit88d6bf04e01f4f006ed2708851e925d59012d591 (patch)
tree0fbd062191d966b7d2d1cc59dcafb9631e02b71f /src/gui/painting
parent80b91ac5f579b5cc310366fb0ea4aa4c813c04bf (diff)
parent6827ea5e97c9f6540f0fae5236f89343c32f4cb8 (diff)
downloadQt-88d6bf04e01f4f006ed2708851e925d59012d591.zip
Qt-88d6bf04e01f4f006ed2708851e925d59012d591.tar.gz
Qt-88d6bf04e01f4f006ed2708851e925d59012d591.tar.bz2
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts: src/s60installs/bwins/QtGuiu.def src/s60installs/eabi/QtGuiu.def
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qpainter.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 9bd9733..1d10d75 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -6469,10 +6469,16 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
QLineF line(pos.x(), pos.y(), pos.x() + qFloor(width), pos.y());
- const qreal underlineOffset = fe->underlinePosition().toReal();
+ qreal underlineOffset = fe->underlinePosition().toReal();
+ qreal y = pos.y();
+ // compensate for different rounding rule in Core Graphics paint engine,
+ // ideally code like this should be moved to respective engines.
+ if (painter->paintEngine()->type() == QPaintEngine::CoreGraphics) {
+ y = qCeil(y);
+ }
// deliberately ceil the offset to avoid the underline coming too close to
// the text above it.
- const qreal underlinePos = pos.y() + qCeil(underlineOffset);
+ const qreal underlinePos = y + qCeil(underlineOffset);
if (underlineStyle == QTextCharFormat::SpellCheckUnderline) {
underlineStyle = QTextCharFormat::UnderlineStyle(QApplication::style()->styleHint(QStyle::SH_SpellCheckUnderlineStyle));