diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2018-12-21 11:31:24 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2019-01-03 08:48:41 +0000 |
commit | ceddc14af17df166d05d98cfa76256bfc0b34183 (patch) | |
tree | 68112485f9cb24e3bd538b6cedc9e7b274b891cb /src/gui | |
parent | f9d8762d37d83e3f3f21adfece0dbbb15886d722 (diff) |
Draw ShowTabsAndSpaces symbols with the correct font
We would draw the tab and space symbols without setting the correct
font on the painter first.
[ChangeLog][QtGui][Text] Fixed so ShowTabsAndSpaces will use the
correct font.
Fixes: QTBUG-62540
Change-Id: I3b7d6d317473e7aab722dafe1a128c57a830f634
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index be306ed224..f3f0caa379 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2598,6 +2598,7 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR Qt::IntersectClip); else x /= 2; // Centered + p->setFont(f); p->drawText(QPointF(iterator.x.toReal() + x, y.toReal()), visualTab); } @@ -2671,8 +2672,11 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR if (c.style() != Qt::NoBrush) p->setPen(c.color()); QChar visualSpace(si.analysis.flags == QScriptAnalysis::Space ? (ushort)0xb7 : (ushort)0xb0); + QFont oldFont = p->font(); + p->setFont(eng->font(si)); p->drawText(QPointF(iterator.x.toReal(), itemBaseLine.toReal()), visualSpace); p->setPen(pen); + p->setFont(oldFont); } } eng->drawDecorations(p); |