Skip to content

Commit

Permalink
use QWidget Fusion style on Windows 10: enable dark mode
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu Gallien <[email protected]>
  • Loading branch information
mgallien committed Nov 19, 2024
1 parent 3097ce3 commit ab19df2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/gui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@
#include <QMessageBox>
#include <QDebug>
#include <QQuickStyle>
#include <QStyle>
#include <QStyleFactory>
#include <QQuickWindow>
#include <QSurfaceFormat>
#include <QOperatingSystemVersion>

using namespace OCC;

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ab19df2

Please sign in to comment.