diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 2a793a131e9..ed08162c1cb 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -6177,8 +6177,7 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const const qreal underlineOffset = fe->underlinePosition().toReal(); // deliberately ceil the offset to avoid the underline coming too close to // the text above it. - const qreal aliasedCoordinateDelta = 0.5 - 0.015625; - const qreal underlinePos = pos.y() + qCeil(underlineOffset) - aliasedCoordinateDelta; + const qreal underlinePos = pos.y() + qCeil(underlineOffset); if (underlineStyle == QTextCharFormat::SpellCheckUnderline) { underlineStyle = QTextCharFormat::SpellCheckUnderline; // ### Qt5 QTextCharFormat::UnderlineStyle(QApplication::style()->styleHint(QStyle::SH_SpellCheckUnderlineStyle)); diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index dbf1b457f6f..d1f168805a1 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -3046,7 +3046,7 @@ void QTextEngine::adjustUnderlines(ItemDecorationList::iterator start, { for (ItemDecorationList::iterator it = start; it != end; ++it) { it->y = underlinePos; - it->pen.setWidth(penWidth); + it->pen.setWidthF(penWidth); } }