set the windows native qml style on windows systems
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Wed, 7 Aug 2024 19:28:27 +0000 (21:28 +0200)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Fri, 6 Sep 2024 08:42:08 +0000 (10:42 +0200)
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/gui/main.cpp

index b1794106a5d4e5adc8a9f4bd4d9f1c07e49d5d6b..1c197eb5a1d2c156e9f1ee32e6c6fa94373eb129 100644 (file)
@@ -73,25 +73,16 @@ int main(int argc, char **argv)
 
     auto style = QStringLiteral("Fusion");
 
-#ifdef Q_OS_MAC
+#if defined Q_OS_MAC
     style = QStringLiteral("macOS");
+#elif defined Q_OS_WIN
+    style = QStringLiteral("Windows");
 #endif
 
-    OCC::Application 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) {
-        style = "Windows";
-    }
-#endif // Q_OS_WIN
-
     QQuickStyle::setStyle(style);
 
+    OCC::Application app(argc, argv);
+
 #ifndef Q_OS_WIN
     signal(SIGPIPE, SIG_IGN);
 #endif