Enable Qt's high-DPI scaling introduced in Qt5.6
authorromibi <romibi@bluewin.ch>
Thu, 14 Jul 2016 09:36:07 +0000 (11:36 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 28 Feb 2018 22:24:52 +0000 (23:24 +0100)
Resolves GH-233.

(cherry picked from commit d6129e6eb33cabdda455b1c2a71f9fb9bf4efb9d)

src/common/main.cpp

index a9dafcc..1f39731 100644 (file)
@@ -177,13 +177,19 @@ int main(int argc, char **argv)
     }
 #endif
 
-#  if defined BUILD_CORE
+#if defined BUILD_CORE
     CoreApplication app(argc, argv);
-#  elif defined BUILD_QTUI
+#elif defined BUILD_QTUI
+# if QT_VERSION >= 0x050600
+    QtUiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+# endif
     QtUiApplication app(argc, argv);
-#  elif defined BUILD_MONO
+#elif defined BUILD_MONO
+# if QT_VERSION >= 0x050600
+    MonolithicApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+# endif
     MonolithicApplication app(argc, argv);
-#  endif
+#endif
 
 #ifndef HAVE_KDE4
     // the non-KDE version parses after app has been instantiated