diff --git a/src/plasmaquick/appletquickitem.cpp b/src/plasmaquick/appletquickitem.cpp --- a/src/plasmaquick/appletquickitem.cpp +++ b/src/plasmaquick/appletquickitem.cpp @@ -504,17 +504,20 @@ //Force QtQuickControls to use the "Plasma" style for this engine. //this way is possible to mix QtQuickControls and plasma components in applets //while still having the desktop style in configuration dialogs - QQmlComponent c(engine); - c.setData(QByteArrayLiteral("import QtQuick 2.1\n\ - import QtQuick.Controls 1.0\n\ - import QtQuick.Controls.Private 1.0\n \ - Item {\ - Component.onCompleted: {\ - Settings.styleName = \"Plasma\";\ - }\ - }"), QUrl()); - QObject *o = c.create(); - o->deleteLater(); + if (!engine->property("_plasma_qqc_style_set").toBool()) { + QQmlComponent c(engine); + c.setData(QByteArrayLiteral("import QtQuick 2.1\n\ + import QtQuick.Controls 1.0\n\ + import QtQuick.Controls.Private 1.0\n \ + QtObject {\ + Component.onCompleted: {\ + Settings.styleName = \"Plasma\";\ + }\ + }"), QUrl()); + QObject *o = c.create(); + o->deleteLater(); + engine->setProperty(("_plasma_qqc_style_set"), true); + } d->qmlObject->setSource(QUrl::fromLocalFile(d->applet->kPackage().filePath("mainscript")));