export plasmoid.rootItem

This commit is contained in:
Marco Martin 2014-05-09 13:12:38 +02:00
parent 39047a0ab8
commit 91e6297114
2 changed files with 12 additions and 0 deletions

View File

@ -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)

View File

@ -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;