From 4a718113abdc16b37f57b4f83a9a609ef0281719 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Mon, 7 Dec 2020 10:44:48 +0100 Subject: Allow style to be set to "Default" for compatibility This unbreaks Qt 5 applications that weren't specifying a style or were specifying Default. [ChangeLog][Important Behavior Changes] Setting the style to "Default" now behaves the same way as not specifying a style; a relevant style will be chosen based on the platform. To use the style previously known as "Default", use "Basic". Task-number: QTBUG-85984 Pick-to: 6.0 Change-Id: I8e5533f9c6834765610773e46f97fbd56a242039 Reviewed-by: Volker Hilsheimer --- src/quickcontrols2/qquickstyle.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/quickcontrols2') diff --git a/src/quickcontrols2/qquickstyle.cpp b/src/quickcontrols2/qquickstyle.cpp index bbbd7fb1..f4e1da00 100644 --- a/src/quickcontrols2/qquickstyle.cpp +++ b/src/quickcontrols2/qquickstyle.cpp @@ -184,8 +184,11 @@ struct QQuickStyleSpec // Find the config file. resolveConfigFilePath(); - if (style.isEmpty()) { - qCDebug(lcQtQuickControlsStyle) << "no style was specified; checking if we have an appropriate style for this platform"; + if (style.isEmpty() || style.toLower() == QStringLiteral("default")) { + style.clear(); + + qCDebug(lcQtQuickControlsStyle) << "no style (or Default) was specified;" + << "checking if we have an appropriate style for this platform"; #if defined(Q_OS_MACOS) style = QLatin1String("macOS"); #elif defined(Q_OS_WINDOWS) -- cgit v1.2.3