From 8cac56c2463f2bc2d2c1e7345d9d3e9d88c1c964 Mon Sep 17 00:00:00 2001 From: Martchus Date: Fri, 15 Dec 2023 15:49:31 +0100 Subject: [PATCH] Use `QWizard::AeroStyle` also with Qt 6.7's `windows11` style This is likely going to work as the `windows11` style seems to be a continuation of the `windowsvista` so let's give it a try. --- syncthingwidgets/settings/wizard.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/syncthingwidgets/settings/wizard.cpp b/syncthingwidgets/settings/wizard.cpp index a00c2ce..d931cea 100644 --- a/syncthingwidgets/settings/wizard.cpp +++ b/syncthingwidgets/settings/wizard.cpp @@ -55,12 +55,14 @@ Wizard::Wizard(QWidget *parent, Qt::WindowFlags flags) : QWizard(parent, flags) { #ifdef Q_OS_WINDOWS - // avoid using QWizard::AeroStyle when not also the Qt Widgets style "windowsvista" is used + // avoid using QWizard::AeroStyle when not also the Qt Widgets style "windowsvista"/"windows11" is used // note: Otherwise the wizard is quite unusable with a dark color palette. auto fallbackToModernStyle = false; #if QT_VERSION >= QT_VERSION_CHECK(6, 1, 0) if (const auto *const style = QApplication::style()) { - if (style->name().compare(QLatin1String("windowsvista"), Qt::CaseInsensitive) != 0) { + const auto name = style->name(); + if (name.compare(QLatin1String("windowsvista"), Qt::CaseInsensitive) != 0 + && name.compare(QLatin1String("windows11"), Qt::CaseInsensitive) != 0) { setWizardStyle(QWizard::ModernStyle); fallbackToModernStyle = true; }