diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-08-28 10:33:33 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-08-28 10:34:00 +0200 |
commit | be487bdb038cb01fa938adde9997e2761900e29d (patch) | |
tree | 870d3652807c8e9e4bbcc190be72dc4c730316a4 /tests | |
parent | 8c3b19bc0afe94de49e008e7292a8aeed9cc4cfa (diff) | |
parent | 3ffd2e4ee3229e714eed497c1ae3a3bbbcabe8cf (diff) | |
download | qtquickcontrols-be487bdb038cb01fa938adde9997e2761900e29d.tar.gz |
Merge remote-tracking branch 'origin/5.5' into 5.6
Change-Id: Ie81aa6abe8a4acbd201e4938f0cb693a8b3aa567
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_tableview.qml | 48 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_treeview.qml | 14 |
2 files changed, 61 insertions, 1 deletions
diff --git a/tests/auto/controls/data/tst_tableview.qml b/tests/auto/controls/data/tst_tableview.qml index 9bb2cd67..a01df56f 100644 --- a/tests/auto/controls/data/tst_tableview.qml +++ b/tests/auto/controls/data/tst_tableview.qml @@ -1070,5 +1070,53 @@ TestCase { control.destroy() } + + ListModel { + id: testModel + + ListElement { + name: "Red" + color: "#ff0000" + } + ListElement { + name: "Green" + color: "#00ff00" + } + ListElement { + name: "Blue" + color: "#0000ff" + } + } + + Component { + id: tableViewComponent + + TableView { + model: testModel + anchors.fill: parent + sortIndicatorVisible: true + + TableViewColumn { + title: "Name" + role: "name" + width: 100 + } + + TableViewColumn { + title: "Color" + role: "color" + width: 100 + } + } + } + + function test_sortIndicatorAfterColumnMoved() { + var tableView = tableViewComponent.createObject(testCase); + verify(tableView); + + compare(tableView.sortIndicatorColumn, 0); + tableView.moveColumn(0, 1); + compare(tableView.sortIndicatorColumn, 1); + } } } diff --git a/tests/auto/controls/data/tst_treeview.qml b/tests/auto/controls/data/tst_treeview.qml index 6e17e318..33e64e65 100644 --- a/tests/auto/controls/data/tst_treeview.qml +++ b/tests/auto/controls/data/tst_treeview.qml @@ -736,7 +736,7 @@ Item { compare(component.status, Component.Ready) var tree = component.createObject(container); verify(tree !== null, "tree created is null") - waitForRendering(tree) + verify(waitForRendering(tree), "TreeView did not render on time") var model = tree.model // Sample each row and test @@ -744,6 +744,12 @@ Item { for (var x = 1; x < tree.getColumn(0).width; x += 10) { var treeIndex = tree.indexAt(x, 50 * (row + 1) + 1) // offset by header height var modelIndex = model.index(row, 0) + if (treeIndex.row !== modelIndex.row + || treeIndex.column !== modelIndex.column + || treeIndex.internalId !== modelIndex.internalId) { + console.log("Test about to fail: row = " + row + ", __listView.count =" + __listView.count) + console.log(" . . . . . . . . . x =" + x + ", getColumn(0).width =" + getColumn(0).width) + } compare(treeIndex.row, modelIndex.row) compare(treeIndex.column, modelIndex.column) compare(treeIndex.internalId, modelIndex.internalId) @@ -756,6 +762,12 @@ Item { for (x = 1; x < tree.getColumn(0).width; x += 10) { treeIndex = tree.indexAt(x, 50 * row + 1) modelIndex = model.index(row, 0) + if (treeIndex.row !== modelIndex.row + || treeIndex.column !== modelIndex.column + || treeIndex.internalId !== modelIndex.internalId) { + console.log("Test about to fail: row = " + row + ", __listView.count =" + __listView.count) + console.log(" . . . . . . . . . x =" + x + ", getColumn(0).width =" + getColumn(0).width) + } compare(treeIndex.row, modelIndex.row) compare(treeIndex.column, modelIndex.column) compare(treeIndex.internalId, modelIndex.internalId) |