on xenial help sign in
Fix filtering colllapsing/expanding again

Also the delegate creation range stuff flows up->down not down->up so rearrange the bindings

commitf8cf7c6b9784bca027483bf4e56cf531601593b3 authorAlbert Astals <albert.astals@canonical.com> dateTue 10 Dec 2013, 16:39 (13 years ago) parent98a3fda
3 files changed+35−4
Dash/DashFilterGrid.qml+3−2 Dash/DashRenderer.qml+2−2 tests/qmltests/Dash/tst_GenericScopeView.qml+30
Dash/DashFilterGrid.qml+3−2
@@ -35,8 +35,6 @@ DashRenderer {
3535 rows: filter ? filterGrid.collapsedRowCount : filterGrid.uncollapsedRowCount
3636 currentItem: filterGrid.currentItem
3737 expandable: filterGrid.expandable
38− delegateCreationBegin: filterGrid.delegateCreationBegin
39− delegateCreationEnd: filterGrid.delegateCreationEnd
4038 height: filterGrid.height
4139 margins: filterGrid.margins
4240 uncollapsedHeight: filterGrid.uncollapsedHeight
@@ -56,9 +54,12 @@ DashRenderer {
5654 model: dashFilterGrid.model
5755 filter: dashFilterGrid.filter
5856 highlightIndex: dashFilterGrid.highlightIndex
57+ delegateCreationBegin: dashFilterGrid.delegateCreationBegin
58+ delegateCreationEnd: dashFilterGrid.delegateCreationEnd
5959
6060 onFilterChanged: {
6161 dashFilterGrid.filter = filter
62+ filter = Qt.binding(function() { return dashFilterGrid.filter })
6263 }
6364 }
6465}
Dash/DashRenderer.qml+2−2
@@ -38,9 +38,9 @@ Item {
3838
3939 property int uncollapsedHeight: height
4040
41− property real delegateCreationBegin
41+ property var delegateCreationBegin: undefined
4242
43− property real delegateCreationEnd
43+ property var delegateCreationEnd: undefined
4444
4545 property real verticalSpacing: 0
4646
tests/qmltests/Dash/tst_GenericScopeView.qml+30
@@ -276,6 +276,36 @@ Item {
276276 closePreview();
277277 tryCompare(previewListView, "open", false);
278278 }
279+
280+ function test_filter_expand_expand() {
281+ // wait for the item to be there
282+ tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader2") != undefined; }, true);
283+
284+ var categoryListView = findChild(genericScopeView, "categoryListView");
285+ categoryListView.contentY = categoryListView.height;
286+
287+ var header2 = findChild(genericScopeView, "dashSectionHeader2")
288+ var category2 = findChild(genericScopeView, "dashCategory2")
289+ var category2FilterGrid = category2.children[0].children[0].children[0];
290+ verify(UT.Util.isInstanceOf(category2FilterGrid, "FilterGrid"));
291+
292+ waitForRendering(header2);
293+ verify(category2.expandable);
294+ verify(category2.filtered);
295+
296+ mouseClick(header2, header2.width / 2, header2.height / 2);
297+ tryCompare(category2, "filtered", false);
298+ tryCompare(category2FilterGrid, "filter", false);
299+
300+ categoryListView.positionAtBeginning();
301+
302+ var header0 = findChild(genericScopeView, "dashSectionHeader0")
303+ var category0 = findChild(genericScopeView, "dashCategory0")
304+ mouseClick(header0, header0.width / 2, header0.height / 2);
305+ tryCompare(category0, "filtered", false);
306+ tryCompare(category2, "filtered", true);
307+ tryCompare(category2FilterGrid, "filter", true);
308+ }
279309 }
280310 }
281311}