diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-04-26 15:41:47 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-04-28 08:38:59 (GMT) |
commit | 5d033928fc94e04cb4d7746dae2269f2be753925 (patch) | |
tree | 5c1f8cec0cdc0d31ae6c8c7c8a3bb22e2a2b8f90 | |
parent | 07ba36e03540591f25c75593f8a24c307ab4a8cd (diff) | |
download | Qt-5d033928fc94e04cb4d7746dae2269f2be753925.zip Qt-5d033928fc94e04cb4d7746dae2269f2be753925.tar.gz Qt-5d033928fc94e04cb4d7746dae2269f2be753925.tar.bz2 |
Fix tab stop in QPainter::drawText()
Even though we'd set the local tabstops variable to eight times the
width of 'x', we'd never use this value anywhere, causing the text
layout to use a default value of 80. This looked okay with some font
sizes, but since it did not depend on the size of font, the tab in
a large font would be too small and potentially the same size or
smaller than a single character/space. We enable setting the tabstops
on the layout whenever it hasn't been explicitly set on the QTextOption.
Task-number: QTBUG-1638
Reviewed-by: Trond
-rw-r--r-- | src/gui/painting/qpainter.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 898a996..fbeb6e6 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -7906,6 +7906,9 @@ start_lengthVariant: engine.option = *option; } + if (engine.option.tabStop() < 0 && tabstops > 0) + engine.option.setTabStop(tabstops); + engine.option.setTextDirection(layout_direction); if (tf & Qt::AlignJustify) engine.option.setAlignment(Qt::AlignJustify); |