summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>2015-01-06 16:35:05 +0100
committerGabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>2015-02-05 18:01:27 +0100
commitaf24d3754d807cfec1ea480eded2f32de5279f0e (patch)
tree3f5047aaffc2ae60d9182524a82441cff6a6bef0 /tests
parentacf225d671976acf1429883d21d058fe66bec2f8 (diff)
BasicTableView refactoring: Separate view from user interaction
One of the main tasks of the user interaction code is to manage the current items selection. However, in the upcoming TreeView, the selection will be completely different, but we still want to keep 99% of the view code. Also, in our TreeView implementation, the user's model is proxyfied by a TreeModelAdaptor. But that's not the case in the TableView. So, in order to keep using the same API, we introduce the __model intermediate property. Where it makes sense, TableView and TreeView share common API through BasicTableView. Change-Id: I0a922c1c1093919df7d880d72fe12ed0f372cc08
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tableview/tv_keys.qml6
-rw-r--r--tests/auto/controls/data/tst_tableview.qml4
2 files changed, 6 insertions, 4 deletions
diff --git a/tests/auto/controls/data/tableview/tv_keys.qml b/tests/auto/controls/data/tableview/tv_keys.qml
index 2102f55c0..c6f387d67 100644
--- a/tests/auto/controls/data/tableview/tv_keys.qml
+++ b/tests/auto/controls/data/tableview/tv_keys.qml
@@ -49,11 +49,13 @@ Row {
TableView {
id: _control1
property bool gotit: false
+
+ TableViewColumn { }
+
Keys.onPressed: {
+ event.accepted = !gotit
if ((!gotit) && (event.key === Qt.Key_Down)) {
gotit = true;
- event.accepted = true;
- return;
}
}
}
diff --git a/tests/auto/controls/data/tst_tableview.qml b/tests/auto/controls/data/tst_tableview.qml
index 71f92a3f7..97224bafd 100644
--- a/tests/auto/controls/data/tst_tableview.qml
+++ b/tests/auto/controls/data/tst_tableview.qml
@@ -516,7 +516,7 @@ TestCase {
table.forceActiveFocus();
// to go to next row (this model has 10 rows)
- table.__incrementCurrentIndex()
+ table.__listView.incrementCurrentIndex()
// read data from the model directly
var valuefrommodel = table.model.dataAt(table.currentRow)
@@ -545,7 +545,7 @@ TestCase {
table.forceActiveFocus();
// to go to next row (this model has 3 rows, read the second row)
- table.__incrementCurrentIndex()
+ table.__listView.incrementCurrentIndex()
verify(table.__currentRowItem !== undefined, "No current item found")
var label = findAChild(table.__currentRowItem, "label")