Crashreporter: Apply the same hdpi settings as to the main gui
authorHannah von Reth <hannah.vonreth@owncloud.com>
Mon, 7 Sep 2020 09:58:50 +0000 (11:58 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:59:18 +0000 (10:59 +0100)
Fixes: #8042
src/crashreporter/main.cpp

index 631c211b5041869f83e2a84f93d5f47054fc7a8f..7d647426f00765acd8951d92cec8228c766c01e5 100644 (file)
 
 int main(int argc, char *argv[])
 {
+    QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
+#ifdef Q_OS_WIN
+    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
+#endif // !Q_OS_WIN
     QApplication app(argc, argv);
 
+#ifdef Q_OS_WIN
+    // The Windows style still has pixelated elements with Qt 5.6,
+    // it's recommended to use the Fusion style in this case, even
+    // though it looks slightly less native. Check here after the
+    // QApplication was constructed, but before any QWidget is
+    // constructed.
+    if (app.devicePixelRatio() > 1)
+        QApplication::setStyle(QStringLiteral("fusion"));
+#endif // Q_OS_WIN
+
     if (app.arguments().size() != 2) {
         qDebug() << "You need to pass the .dmp file path as only argument";
         return 1;