From 91e6297114795163eda458de991da6766fdbecb4 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 9 May 2014 13:12:38 +0200 Subject: [PATCH] export plasmoid.rootItem --- src/plasmaquick/appletquickitem.cpp | 5 +++++ src/plasmaquick/appletquickitem.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/src/plasmaquick/appletquickitem.cpp b/src/plasmaquick/appletquickitem.cpp index a24bd4f87..aba9aefa5 100644 --- a/src/plasmaquick/appletquickitem.cpp +++ b/src/plasmaquick/appletquickitem.cpp @@ -680,6 +680,11 @@ QObject *AppletQuickItem::fullRepresentationItem() return d->fullRepresentationItem.data(); } +QObject *AppletQuickItem::rootItem() +{ + return d->qmlObject->rootObject(); +} + void AppletQuickItem::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) { Q_UNUSED(oldGeometry) diff --git a/src/plasmaquick/appletquickitem.h b/src/plasmaquick/appletquickitem.h index 269a7f7be..cc2914ddf 100644 --- a/src/plasmaquick/appletquickitem.h +++ b/src/plasmaquick/appletquickitem.h @@ -80,6 +80,12 @@ class PLASMAQUICK_EXPORT AppletQuickItem : public QQuickItem */ Q_PROPERTY(bool expanded WRITE setExpanded READ isExpanded NOTIFY expandedChanged) + /** + * the applet root QML item: sometimes is the same as fullRepresentationItem + * if a fullrepresentation was not declared explicitly + */ + Q_PROPERTY(QObject *rootItem READ rootItem CONSTANT) + public: AppletQuickItem(Plasma::Applet *applet, QQuickItem *parent = 0); ~AppletQuickItem(); @@ -98,6 +104,7 @@ public: QObject *compactRepresentationItem(); QObject *fullRepresentationItem(); + QObject *rootItem(); ////PROPERTY ACCESSORS int switchWidth() const;