diff options
author | Zhang Hao <zhanghao@uniontech.com> | 2021-03-29 14:55:14 +0800 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2021-04-15 01:43:46 +0000 |
commit | 78c4d0c48f58854127aa9248f597bf8568f440a1 (patch) | |
tree | ec97f8e2cb86681dc4e896fb582c20528d978037 /src/gui | |
parent | 1d59fe368a0bd0c04264618e3e6f09d7ce289d33 (diff) |
Add new enum value VisualTabCharacter into QChar
With this enumeration value, users can get the width of
the current font TAB character more conveniently
In addition, added some documentation about where
users may use this enumeration.
Fixes: QTBUG-92205
Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io>
Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Change-Id: I9794b7553e9299e351f9182de02866d07a1393fc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index b2b87fb92e..381c1d20ce 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2617,7 +2617,7 @@ void QTextLine::draw_internal(QPainter *p, const QPointF &pos, gf.width = iterator.itemWidth; QPainterPrivate::get(p)->drawTextItem(QPointF(iterator.x.toReal(), y.toReal()), gf, eng); if (eng->option.flags() & QTextOption::ShowTabsAndSpaces) { - const QChar visualTab = u'\x2192'; + const QChar visualTab = QChar(QChar::VisualTabCharacter); int w = QFontMetrics(f).horizontalAdvance(visualTab); qreal x = iterator.itemWidth.toReal() - w; // Right-aligned if (x < 0) |