diff --git a/src/platformtheme/kdeplatformtheme.cpp b/src/platformtheme/kdeplatformtheme.cpp --- a/src/platformtheme/kdeplatformtheme.cpp +++ b/src/platformtheme/kdeplatformtheme.cpp @@ -394,12 +394,18 @@ //force QtQuickControls2 to use the desktop theme as default void KdePlatformTheme::setQtQuickControlsTheme() { - //if the user has explicitly set something else, don't meddle - if (qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_STYLE")) { - return; - } //if the user is running only a QGuiApplication. Abort as this style is all about QWidgets and we know setting this will make it crash if (!qobject_cast(qApp)) { + if (qgetenv("QT_QUICK_CONTROLS_STYLE") == "org.kde.desktop") { + qunsetenv("QT_QUICK_CONTROLS_STYLE"); + } + if (qgetenv("QT_QUICK_CONTROLS_1_STYLE").right(7) == "Desktop") { + qunsetenv("QT_QUICK_CONTROLS_1_STYLE"); + } + return; + } + //if the user has explicitly set something else, don't meddle + if (qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_STYLE")) { return; } qputenv("QT_QUICK_CONTROLS_STYLE", "org.kde.desktop");