on xenial help sign in
Add widgetData["expanded"] property for expandable widget.
bfe824eGary.Wzl
qml/Dash/Previews/PreviewExpandable.qml+4−2
@@ -24,14 +24,16 @@ import "../../Components"
24 Those widgets can be collapsed or uncollapsed. When uncollapsed
24 Those widgets can be collapsed or uncollapsed. When uncollapsed
25 all the widgets are shown, when collapsed only the first
25 all the widgets are shown, when collapsed only the first
26 widgetData["collapsed-widgets"] are shown. It has a title that comes
26 widgetData["collapsed-widgets"] are shown. It has a title that comes
27− in via widgetData["title"]
27+ in via widgetData["title"]. This widget expands all child widgets
28+ when construction by specifying widgetData["expanded"] == true.
29+ It's in unexpanded mode by default.
28 */
30 */
29
31
30PreviewWidget {
32PreviewWidget {
31 id: root
33 id: root
32 implicitHeight: childrenRect.height
34 implicitHeight: childrenRect.height
33
35
34− expanded: false
36+ expanded: widgetData["expanded"] == undefined? false : widgetData["expanded"];
35
37
36 Label {
38 Label {
37 id: titleLabel
39 id: titleLabel
qml/Dash/Previews/PreviewWidgetFactory.qml+3−1
@@ -74,8 +74,10 @@ Loader {
74 item.widgetId = Qt.binding(function() { return root.widgetId } )
74 item.widgetId = Qt.binding(function() { return root.widgetId } )
75 item.widgetData = Qt.binding(function() { return root.widgetData } )
75 item.widgetData = Qt.binding(function() { return root.widgetData } )
76 item.isCurrentPreview = Qt.binding(function() { return root.isCurrentPreview } )
76 item.isCurrentPreview = Qt.binding(function() { return root.isCurrentPreview } )
77− item.expanded = Qt.binding(function() { return root.expanded } )
78 item.scopeStyle = Qt.binding(function() { return root.scopeStyle } )
77 item.scopeStyle = Qt.binding(function() { return root.scopeStyle } )
78+
79+ if (widgetType !== "expandable")
80+ item.expanded = Qt.binding(function() { return root.expanded } )
79 }
81 }
80
82
81 Connections {
83 Connections {