Skip to content

Commit

Permalink
FIX: Test platform style
Browse files Browse the repository at this point in the history
- Check whether it could be successfully created
  • Loading branch information
till213 committed May 9, 2024
1 parent e2cc42c commit 66d628a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/SkyDolly/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ static void applyWindows11DefaultStyleWorkaround() noexcept
qDebug() << "main: Windows 11 detected, applying Fusion as default style (workaround).";
#endif
const auto style = QStyleFactory::create(QStringLiteral("Fusion"));
QApplication::setStyle(style);
if (style != nullptr) {
QApplication::setStyle(style);
}
}
}

Expand All @@ -92,7 +94,9 @@ int main(int argc, char **argv) noexcept
const QString styleKey = Settings::getInstance().getStyleKey();
if (styleKey != Settings::DefaultStyleKey) {
const auto style = QStyleFactory::create(styleKey);
QApplication::setStyle(style);
if (style != nullptr) {
QApplication::setStyle(style);
}
} else {
applyWindows11DefaultStyleWorkaround();
}
Expand Down

0 comments on commit 66d628a

Please sign in to comment.