From ab19df29c9f2195ed9d067a6729257add9b634c1 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Tue, 12 Nov 2024 14:11:24 +0100 Subject: [PATCH] use QWidget Fusion style on Windows 10: enable dark mode Signed-off-by: Matthieu Gallien --- src/gui/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/main.cpp b/src/gui/main.cpp index e91fb3be9a1f4..da946bc3b32c0 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -35,8 +35,11 @@ #include #include #include +#include +#include #include #include +#include using namespace OCC; @@ -82,6 +85,12 @@ int main(int argc, char **argv) QQuickStyle::setStyle(style); QQuickStyle::setFallbackStyle(QStringLiteral("Fusion")); +#if defined Q_OS_WIN + if (QOperatingSystemVersion::current().version() < QOperatingSystemVersion::Windows11.version()) { + QApplication::setStyle(QStyleFactory::create("Fusion")); + } +#endif + OCC::Application app(argc, argv); #ifndef Q_OS_WIN