From 194f9187887dd0dad0920eda97d850921bcdd748 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 e91fb3be9..da946bc3b 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