Revert "Use `QWizard::AeroStyle` also with Qt 6.7's `windows11` style"

This reverts commit 8cac56c246 and extends
the related comment as the new Windows 11 style actually supports custom
palettes and then wizard's aero style breaks in the same way as with
Fusion.
This commit is contained in:
Martchus 2023-12-23 23:40:28 +01:00
parent 549be45b55
commit 26f468471a
1 changed files with 5 additions and 5 deletions

View File

@ -55,14 +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"/"windows11" is used
// note: Otherwise the wizard is quite unusable with a dark color palette.
// avoid using QWizard::AeroStyle when not also the Qt Widgets style "windowsvista" is used
// note: Otherwise the wizard is quite unusable with a dark or otherwise customized color palette.
// The Windows 11 style also supports dark/custom palettes so also then the fallback makes
// sense.
auto fallbackToModernStyle = false;
#if QT_VERSION >= QT_VERSION_CHECK(6, 1, 0)
if (const auto *const style = QApplication::style()) {
const auto name = style->name();
if (name.compare(QLatin1String("windowsvista"), Qt::CaseInsensitive) != 0
&& name.compare(QLatin1String("windows11"), Qt::CaseInsensitive) != 0) {
if (style->name().compare(QLatin1String("windowsvista"), Qt::CaseInsensitive) != 0) {
setWizardStyle(QWizard::ModernStyle);
fallbackToModernStyle = true;
}