Work around layouting issue for RTL languages
authorDaniel Molkentin <danimo@owncloud.com>
Wed, 6 Jan 2016 11:51:25 +0000 (12:51 +0100)
committerDaniel Molkentin <danimo@owncloud.com>
Wed, 6 Jan 2016 11:52:58 +0000 (12:52 +0100)
This has been fixed in the meanwhile, but we are still shipping
with Qt 5.4. Also, some Linux Distros will still have older Qt
versions.

Addresses issue #4301

src/gui/application.cpp

index f347020bb59e1a3d21a8e68713aea96762d5a0f3..301856e8905d2b5a2c4c0a7a77d6c67ee07d557d 100644 (file)
@@ -570,6 +570,10 @@ void Application::setupTranslations()
         if (property("ui_lang").isNull())
             setProperty("ui_lang", "C");
     }
+// Work around Qt 5 < 5.5.0 regression, see https://bugreports.qt.io/browse/QTBUG-43447
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) && QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
+    setLayoutDirection(QApplication::tr("QT_LAYOUT_DIRECTION") == QLatin1String("RTL") ? Qt::RightToLeft : Qt::LeftToRight);
+#endif
 }
 
 bool Application::giveHelp()