diff options
author | Liang Qi <liang.qi@digia.com> | 2014-09-24 13:17:51 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2014-10-08 17:53:30 +0200 |
commit | 41f0d5b9d931a378af66f735c57753146053664e (patch) | |
tree | 0718f6d8b5fb027730407e1d1a86ebc402709ec7 /tests/auto/controls/data/tst_tableview.qml | |
parent | 6d7a4f8400c28e2485a18a4ffdad951998257577 (diff) | |
download | qtquickcontrols-41f0d5b9d931a378af66f735c57753146053664e.tar.gz |
Controls: Fixed support for Keys attached property on TableView
By forwarding key events from the internal control.
The key events from internal are Keys.forwardTo TableView, then user
could customize their own behavior.
Autotest are included.
[ChangeLog][TableView] Fixed support for Keys attached property, by
forwarding key events from the internal control.
Change-Id: Ic59273ae2589bf6d1a0ccf5babf8fd1741376e6c
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'tests/auto/controls/data/tst_tableview.qml')
-rw-r--r-- | tests/auto/controls/data/tst_tableview.qml | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_tableview.qml b/tests/auto/controls/data/tst_tableview.qml index b802e7ff..9e37f45e 100644 --- a/tests/auto/controls/data/tst_tableview.qml +++ b/tests/auto/controls/data/tst_tableview.qml @@ -179,6 +179,37 @@ TestCase { table.destroy() } + function test_keys() { + var component = Qt.createComponent("tableview/tv_keys.qml") + compare(component.status, Component.Ready) + var test = component.createObject(container); + verify(test !== null, "test control created is null") + var control1 = test.control1 + verify(control1 !== null) + + control1.forceActiveFocus() + verify(control1.activeFocus) + + control1.selectionMode = SelectionMode.SingleSelection + control1.model = 3 + control1.currentRow = -1 + + verify(control1.gotit === false) + verify(control1.currentRow === -1) + + keyClick(Qt.Key_Down); + verify(control1.activeFocus) + verify(control1.gotit === true) + verify(control1.currentRow === -1) + + keyClick(Qt.Key_Down); + verify(control1.activeFocus) + verify(control1.gotit === true) + verify(control1.currentRow === 0) + + test.destroy() + } + function test_selection() { var component = Qt.createComponent("tableview/table2_qabstractitemmodel.qml") |