From 5d033928fc94e04cb4d7746dae2269f2be753925 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 26 Apr 2010 17:41:47 +0200 Subject: 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 --- src/gui/painting/qpainter.cpp | 3 +++ 1 file changed, 3 insertions(+) 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); -- cgit v0.12