on xenial help sign in
Fix test
3a2d99fAlbert Astals
qml/Components/FilterGrid.qml+9−6
@@ -28,10 +28,13 @@ import "../Components"
28Item {
28Item {
29 id: root
29 id: root
30
30
31+ QtObject {
32+ id: d
31− /* If true, the number of elements displayed will be limited by collapsedRowCount.
33+ /* If true, the number of elements displayed will be limited by collapsedRowCount.
32− If false, all elements will be displayed, effectively looking the same as a regular
34+ If false, all elements will be displayed, effectively looking the same as a regular
33− ResponsiveGridView. Manipulate this property through setFilter */
35+ ResponsiveGridView. Manipulate this property through setFilter */
34− property bool filter: true
36+ property bool filter: true
37+ }
35
38
36 /* Whether, when collapsed, a button should be displayed enabling the user to expand
39 /* Whether, when collapsed, a button should be displayed enabling the user to expand
37 the grid to its full size. */
40 the grid to its full size. */
@@ -81,7 +84,7 @@ Item {
81 easing.type: Easing.InOutQuad
84 easing.type: Easing.InOutQuad
82 onRunningChanged: {
85 onRunningChanged: {
83 if (!running) {
86 if (!running) {
84− limitModel.filter = root.filter;
87+ limitModel.filter = d.filter;
85 }
88 }
86 heightBehaviour.enabled = false;
89 heightBehaviour.enabled = false;
87 }
90 }
@@ -90,7 +93,7 @@ Item {
90
93
91 function setFilter(filter, animate) {
94 function setFilter(filter, animate) {
92 heightBehaviour.enabled = animate;
95 heightBehaviour.enabled = animate;
93− root.filter = filter;
96+ d.filter = filter;
94 if (!animate || !filter) {
97 if (!animate || !filter) {
95 limitModel.filter = filter;
98 limitModel.filter = filter;
96 }
99 }
tests/qmltests/Components/tst_FilterGrid.qml+1−1
@@ -50,6 +50,7 @@ Rectangle {
50 CheckBox {
50 CheckBox {
51 id: filterCheckBox
51 id: filterCheckBox
52 checked: true
52 checked: true
53+ onCheckedChanged: filterGrid.setFilter(checked, false /*animate*/)
53 }
54 }
54 }
55 }
55 }
56 }
@@ -99,7 +100,6 @@ Rectangle {
99 maximumNumberOfColumns: 3
100 maximumNumberOfColumns: 3
100 collapsedRowCount:
101 collapsedRowCount:
101 collapsedRowCountSelector.values[collapsedRowCountSelector.selectedIndex]
102 collapsedRowCountSelector.values[collapsedRowCountSelector.selectedIndex]
102− filter: filterCheckBox.checked
103 minimumHorizontalSpacing: units.gu(1)
103 minimumHorizontalSpacing: units.gu(1)
104 delegateWidth: units.gu(6)
104 delegateWidth: units.gu(6)
105 delegateHeight: units.gu(6)
105 delegateHeight: units.gu(6)