diff options
author | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2015-01-06 16:35:05 +0100 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2015-02-12 13:08:44 +0000 |
commit | a2f81b85d5dfa7fbd3b11557fe38de649a1f6914 (patch) | |
tree | 6488905640b7ec0747794cbe9762d2c1f3ed5a8b /tests | |
parent | 90293338d43791c30a0dd58a5e9cef29dcc0b2f8 (diff) | |
download | qtquickcontrols-a2f81b85d5dfa7fbd3b11557fe38de649a1f6914.tar.gz |
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
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tableview/tv_keys.qml | 6 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_tableview.qml | 4 |
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 46428fa4..1ee39e67 100644 --- a/tests/auto/controls/data/tableview/tv_keys.qml +++ b/tests/auto/controls/data/tableview/tv_keys.qml @@ -45,11 +45,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 33599000..b149e76b 100644 --- a/tests/auto/controls/data/tst_tableview.qml +++ b/tests/auto/controls/data/tst_tableview.qml @@ -512,7 +512,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) @@ -541,7 +541,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") |