From c67938106b49d4b24620277e387cf2dae80a9d8a Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 7 Mar 2012 15:55:17 +0100 Subject: [PATCH] bind plasmoid.rootItem --- scriptengines/javascript/plasmoid/declarativeappletscript.cpp | 2 ++ scriptengines/javascript/plasmoid/declarativeappletscript.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scriptengines/javascript/plasmoid/declarativeappletscript.cpp b/scriptengines/javascript/plasmoid/declarativeappletscript.cpp index 3f3d03136..b6445ff21 100644 --- a/scriptengines/javascript/plasmoid/declarativeappletscript.cpp +++ b/scriptengines/javascript/plasmoid/declarativeappletscript.cpp @@ -145,6 +145,8 @@ void DeclarativeAppletScript::qmlCreationFinished() //If it's a popupapplet and the root object has a "compactRepresentation" component, use that instead of the icon Plasma::Applet *a = applet(); Plasma::PopupApplet *pa = qobject_cast(a); + m_self.setProperty("rootItem", m_engine->newQObject(m_declarativeWidget->rootObject())); + if (pa) { QDeclarativeComponent *iconComponent = m_declarativeWidget->rootObject()->property("compactRepresentation").value(); if (iconComponent) { diff --git a/scriptengines/javascript/plasmoid/declarativeappletscript.h b/scriptengines/javascript/plasmoid/declarativeappletscript.h index d57dac448..57689ba0a 100644 --- a/scriptengines/javascript/plasmoid/declarativeappletscript.h +++ b/scriptengines/javascript/plasmoid/declarativeappletscript.h @@ -41,7 +41,7 @@ class EngineAccess; class DeclarativeAppletScript : public AbstractJsAppletScript { -Q_OBJECT + Q_OBJECT public: DeclarativeAppletScript(QObject *parent, const QVariantList &args);