From a2ef6f29873c9c05ecb819dfea57bc1dd0c4799f Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 31 Mar 2024 12:12:20 +0300 Subject: [PATCH] prioritize cleanlooks style because the default in QGuiPlatformPlugin is cleanlooks Signed-off-by: Ivailo Monev --- src/gui/styles/qproxystyle.cpp | 4 ++-- src/gui/styles/qstylefactory.cpp | 23 +++++++++++------------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/gui/styles/qproxystyle.cpp b/src/gui/styles/qproxystyle.cpp index c33c03386..c8c795d17 100644 --- a/src/gui/styles/qproxystyle.cpp +++ b/src/gui/styles/qproxystyle.cpp @@ -78,8 +78,8 @@ void QProxyStylePrivate::ensureBaseStyle() const if (!baseStyle) // Use application desktop style baseStyle = QStyleFactory::create(QApplicationPrivate::desktopStyleKey()); - if (!baseStyle) // Fallback to windows style - baseStyle = QStyleFactory::create(QLatin1String("windows")); + if (!baseStyle) // Fallback to cleanlooks style + baseStyle = QStyleFactory::create(QLatin1String("cleanlooks")); baseStyle->setProxy(const_cast(q)); baseStyle->setParent(const_cast(q)); // Take ownership diff --git a/src/gui/styles/qstylefactory.cpp b/src/gui/styles/qstylefactory.cpp index 25b23a6d0..bbb66af9a 100644 --- a/src/gui/styles/qstylefactory.cpp +++ b/src/gui/styles/qstylefactory.cpp @@ -46,10 +46,9 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, stylesloader, (QString::fromLatin1("/s styles are either built-in or dynamically loaded from a style plugin (see QStylePlugin). - The valid keys can be retrieved using the keys() - function. Typically they include "windows", "motif", - "plastique" and "cleanlooks". Note that keys are case - insensitive. + The valid keys can be retrieved using the keys() function. + Typically they include "windows" and "cleanlooks". Note that keys + are case-insensitive. \sa QStyle */ @@ -67,16 +66,16 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, stylesloader, (QString::fromLatin1("/s */ QStyle *QStyleFactory::create(const QString& key) { -#ifndef QT_NO_STYLE_WINDOWS - if (key.compare(QLatin1String("Windows"), Qt::CaseInsensitive) == 0) { - return new QWindowsStyle(); - } -#endif #ifndef QT_NO_STYLE_CLEANLOOKS if (key.compare(QLatin1String("Cleanlooks"), Qt::CaseInsensitive) == 0) { return new QCleanlooksStyle(); } #endif +#ifndef QT_NO_STYLE_WINDOWS + if (key.compare(QLatin1String("Windows"), Qt::CaseInsensitive) == 0) { + return new QWindowsStyle(); + } +#endif #if !defined(QT_NO_LIBRARY) if (QStylePlugin *plugin = qobject_cast(stylesloader()->instance(key))) { QStyle *ret = plugin->create(key); @@ -105,11 +104,11 @@ QStringList QStyleFactory::keys() #else QStringList list; #endif -#ifndef QT_NO_STYLE_WINDOWS - list << QLatin1String("Windows"); -#endif #ifndef QT_NO_STYLE_CLEANLOOKS list << QLatin1String("Cleanlooks"); +#endif +#ifndef QT_NO_STYLE_WINDOWS + list << QLatin1String("Windows"); #endif return list; }