diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-09-25 20:59:06 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-09-25 20:59:06 +0200 |
commit | e8d4677e309e11cc5177bc10d9d01aa200407cee (patch) | |
tree | b0a3f0200455ba22452e076017a2e64cd602fb3c /tests | |
parent | 59f7b30d41b06b1d9da81aea5784d57ecd91ab04 (diff) | |
parent | 53ff51b61a3ecfc485d7c8ec6d9a5b61d2791719 (diff) | |
download | qtquickcontrols-e8d4677e309e11cc5177bc10d9d01aa200407cee.tar.gz |
Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: Id85e82801b77faf9a32177838025696aab64f002
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 | ||||
-rw-r--r-- | tests/auto/extras/data/tst_delaybutton.qml | 18 |
3 files changed, 67 insertions, 13 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) diff --git a/tests/auto/extras/data/tst_delaybutton.qml b/tests/auto/extras/data/tst_delaybutton.qml index ee95a09a..6c86ece4 100644 --- a/tests/auto/extras/data/tst_delaybutton.qml +++ b/tests/auto/extras/data/tst_delaybutton.qml @@ -55,8 +55,7 @@ TestCase { verify(button.__style) verify(!button.checked) verify(!button.pressed) - // QTBUG-44664 -// button.destroy() + button.destroy() } SignalSpy { @@ -94,8 +93,7 @@ TestCase { verify(!button.pressed) compare(activationSpy.count, 1) - // QTBUG-44664 -// button.destroy() + button.destroy() } SignalSpy { @@ -115,8 +113,7 @@ TestCase { tryCompare(button, "progress", 1.0) verify(progressSpy.count > 0) - // QTBUG-44664 -// button.destroy() + button.destroy() } SignalSpy { @@ -171,8 +168,7 @@ TestCase { verify(!button.checked) compare(checkSpy.count, checkCount) - // QTBUG-44664 -// button.destroy() + button.destroy() } function test_programmaticCheck() { @@ -189,8 +185,7 @@ TestCase { button.checked = false; compare(button.progress, 0); - // QTBUG-44664 -// button.destroy(); + button.destroy(); } function test_largeText() { @@ -198,7 +193,6 @@ TestCase { var button = Qt.createQmlObject("import QtQuick.Extras 1.4; DelayButton { " + "anchors.centerIn: parent; text: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' }", testcase, ""); verify(button, "DelayButton: failed to create an instance"); - // QTBUG-44664 -// button.destroy(); + button.destroy(); } } |