summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/main.cpp')
-rw-r--r--Swift/QtUI/main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Swift/QtUI/main.cpp b/Swift/QtUI/main.cpp
index 4850b49..472c99a 100644
--- a/Swift/QtUI/main.cpp
+++ b/Swift/QtUI/main.cpp
@@ -107,6 +107,14 @@ int main(int argc, char* argv[]) {
QtTranslator swiftTranslator;
Swift::Translator::setInstance(&swiftTranslator);
+#if QT_VERSION < 0x050501
+ /* According to Qt documenation, Qt is suppsoed to set the applications layout
+ * direction based on the translatable QT_LAYOUT_DIRECTION string. There is a
+ * bug in Qt prior version 5.5.1, i.e. QTBUG-43447, thus we set the layout
+ * direction manually based on the tranlsated QT_LAYOUT_DIRECTION string.
+ */
+ app.setLayoutDirection(QGuiApplication::tr("QT_LAYOUT_DIRECTION") == QLatin1String("RTL") ? Qt::RightToLeft : Qt::LeftToRight);
+#endif
Swift::QtSwift swift(vm);
int result = app.exec();