diff options
Diffstat (limited to 'src/private/qquickcontrolsettings.cpp')
| -rw-r--r-- | src/private/qquickcontrolsettings.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/private/qquickcontrolsettings.cpp b/src/private/qquickcontrolsettings.cpp index 161398322..01456b2a1 100644 --- a/src/private/qquickcontrolsettings.cpp +++ b/src/private/qquickcontrolsettings.cpp @@ -54,14 +54,20 @@ QString QQuickControlSettings::theme() { static QString currentTheme; if (currentTheme.isEmpty()) { - currentTheme = QLatin1String("Styles/Base"); -#ifndef QT_NO_WIDGETS - //Only enable QStyle support when we are using QApplication - if (QCoreApplication::instance()->inherits("QApplication")) { - if (qgetenv("QT_QUICK_CONTROLS_NO_WIDGETS").toInt() < 1) - currentTheme = QLatin1String("Styles/Desktop"); + //Following variable is for internal use only. It is very possible + //that it will disappear in future releases. + currentTheme = qgetenv("QT_QUICK_CONTROLS_STYLE"); + + if (currentTheme.isEmpty()) { + //Only enable QStyle support when we are using QApplication + if (QCoreApplication::instance()->inherits("QApplication")) + currentTheme = QLatin1String("Desktop"); + else + currentTheme = QLatin1String("Base"); } -#endif + + if (!currentTheme.startsWith(QLatin1String("Styles/"))) + currentTheme.prepend(QLatin1String("Styles/")); } return currentTheme; } |
