Skip to content

Commit

Permalink
use correct qml style on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Jyrki Gadinger <[email protected]>
  • Loading branch information
nilsding committed Jan 31, 2025
1 parent 2447c01 commit 176d804
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/gui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,18 @@ int main(int argc, char **argv)

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

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

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

QQuickStyle::setStyle(style);

Check warning on line 94 in src/gui/main.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/main.cpp:94:27 [cppcoreguidelines-init-variables]

variable 'style' is not initialized
QQuickStyle::setFallbackStyle(QStringLiteral("Fusion"));

OCC::Application app(argc, argv);

#ifndef Q_OS_WIN
Expand Down

0 comments on commit 176d804

Please sign in to comment.