Loader {
id: root
//! Identifier of the widget.
property string widgetId: ""
//! Type of the widget to display.
property string widgetType: ""
//! Widget data, forwarded to the widget as is.
property var widgetData: null
//! The ScopeStyle component.
property var scopeStyle: null
//! Should the widget show in expanded mode (For those that support it)
property bool expanded: widgetType !== "expandable"
//! Triggered signal forwarded from the widgets.
signal triggered(string widgetId, string actionId, var data)
source: widgetSource
//! \cond private
property url widgetSource: {
switch (widgetType) {
default: return "";
}
}
//! \endcond
onLoaded: {
item.widgetId = Qt.binding(function() { return root.widgetId } )
item.widgetData = Qt.binding(function() { return root.widgetData } )
item.expanded = Qt.binding(function() { return root.expanded } )
item.scopeStyle = Qt.binding(function() { return root.scopeStyle } )
}
Connections {
target: root.item
onTriggered: root.triggered(widgetId, actionId, data)
}
}