Ubuntu Pastebin

Paste from Cimi at Fri, 4 Sep 2015 13:53:22 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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)
    }
}
Download as text