summaryrefslogtreecommitdiff
path: root/tests/auto/controls/data/tst_tableview.qml
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@theqtcompany.com>2015-08-04 14:28:00 +0200
committerMitch Curtis <mitch.curtis@theqtcompany.com>2015-08-12 10:42:44 +0000
commit34bf7f52165b11aa862f46e4f7ace7670bf7bc48 (patch)
tree6f81a4e4cfe34eda1a6ca5c8319ce1b3f9e58c6a /tests/auto/controls/data/tst_tableview.qml
parent54852626c143211e1d5c68b0863fbf29ac460ab5 (diff)
downloadqtquickcontrols-34bf7f52165b11aa862f46e4f7ace7670bf7bc48.tar.gz
Make TableView sort indicator follow moved columns.
Change-Id: I7041fbe141f9f95be3e6d5c6a9f0abf543877194 Task-number: QTBUG-44185 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Diffstat (limited to 'tests/auto/controls/data/tst_tableview.qml')
-rw-r--r--tests/auto/controls/data/tst_tableview.qml48
1 files changed, 48 insertions, 0 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);
+ }
}
}