From 72fc24222ab7f89dc9e606e315ebfb134ba157a8 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 15 Sep 2009 15:22:10 +0200 Subject: Fix drawing text in QPicture and printing in right-to-left mode Change 979d1d3bbc0c68789edbe93f03464d41d7a8469a requires qt_format_text() to honor the Qt::TextForceLeftToRight flag. Without this, the text will be laid out RTL twice, and the output will be broken. Since printing is done through QPicture, this fixes printing when the UI is reversed. Task-number: 261033 Reviewed-by: Trond --- src/gui/painting/qpainter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 358e856..97f3dd4 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -7469,7 +7469,11 @@ void qt_format_text(const QFont &fnt, const QRectF &_r, bool hidemnmemonic = (tf & Qt::TextHideMnemonic); Qt::LayoutDirection layout_direction; - if(option) + if (tf & Qt::TextForceLeftToRight) + layout_direction = Qt::LeftToRight; + else if (tf & Qt::TextForceRightToLeft) + layout_direction = Qt::RightToLeft; + else if (option) layout_direction = option->textDirection(); else if (painter) layout_direction = painter->layoutDirection(); -- cgit v0.12