Skip to content

Commit

Permalink
on windows use Qt FluentWinUI3 style unless win10: Universal
Browse files Browse the repository at this point in the history
use Universal qmt style on windows release before windows 11 then use
FluentWinUI3 which should fit with default windows 11 native style

Signed-off-by: Matthieu Gallien <[email protected]>
  • Loading branch information
mgallien committed Jan 27, 2025
1 parent d7ada98 commit 21c2407
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ int main(int argc, char **argv)

#if defined Q_OS_MAC
style = QStringLiteral("macOS");
#elif defined Q_OS_WIN
style = QStringLiteral("FluentWinUI3");
#endif

QQuickStyle::setStyle(style);
QQuickStyle::setFallbackStyle(QStringLiteral("Fusion"));

#if defined Q_OS_WIN
if (QOperatingSystemVersion::current().version() < QOperatingSystemVersion::Windows11.version()) {
QApplication::setStyle(QStyleFactory::create("Fusion"));
QApplication::setStyle(QStyleFactory::create("Universal"));
} else {
style = QStringLiteral("FluentWinUI3");
}
#endif

Expand Down

0 comments on commit 21c2407

Please sign in to comment.