bind plasmoid.rootItem

This commit is contained in:
Marco Martin 2012-03-07 15:55:17 +01:00
parent 9e5451a1df
commit c67938106b
2 changed files with 3 additions and 1 deletions

View File

@ -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<Plasma::PopupApplet *>(a);
m_self.setProperty("rootItem", m_engine->newQObject(m_declarativeWidget->rootObject()));
if (pa) {
QDeclarativeComponent *iconComponent = m_declarativeWidget->rootObject()->property("compactRepresentation").value<QDeclarativeComponent *>();
if (iconComponent) {

View File

@ -41,7 +41,7 @@ class EngineAccess;
class DeclarativeAppletScript : public AbstractJsAppletScript
{
Q_OBJECT
Q_OBJECT
public:
DeclarativeAppletScript(QObject *parent, const QVariantList &args);