|author||Jan Arve Saether <firstname.lastname@example.org>||2015-02-03 14:54:52 +0100|
|committer||Oswald Buddenhagen <email@example.com>||2015-02-05 14:27:22 +0000|
Fix regression from Qt4 with layout direction
In Qt4, if the result of the translation QApplication::translate("QT_LAYOUT_DIRECTION") returned "RTL", Qt usually called QApplication::setLayoutDirection(Qt::RightToLeft) in order for a translation file to specify if the UI should be left-to-right or right-to-left. However, due to modularization, we could no longer call QApplication::translate(), so the code was wrongly changed to call QCoreApplication::translate(....) instead. This was wrong, and in addition the translation files was never updated with the new context. This patch fixes it to only translate it with the QGuiApplication context. This is the only sensible context, since QApplication would lack QtQuick support, and QCoreApplication would not know how to change layout direction. [ChangeLog][QtGui][i18n] Fixed bug where layout direction did not switch according to the instruction in the translation file. Task-number: QTBUG-43447 Change-Id: Id0409a42d41b3b9ff1cd53d090c4d9c9802f5659 Reviewed-by: Oswald Buddenhagen <firstname.lastname@example.org>
Diffstat (limited to 'src')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 23deb2c4b2..d44a79b37e 100644
@@ -179,7 +179,7 @@ extern void qInitImageConversions();
static bool qt_detectRTLLanguage()
return force_reverse ^
"Translate this string to the string 'LTR' in left-to-right"
" languages or to 'RTL' in right-to-left languages (such as Hebrew"
" and Arabic) to get proper widget layout.") == QLatin1String("RTL"));