diff options
author | Liang Qi <liang.qi@digia.com> | 2014-01-21 13:07:21 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-22 16:09:31 +0100 |
commit | 5dc805c86077ee9cd10af530f802fdda879cfb6a (patch) | |
tree | 44a13a83b6e79d0e81420b2167eaf20b018f01c6 /tests/auto/controls/data/tst_combobox.qml | |
parent | 5e022a65531b92d4d2f4cf9a0dd6b843aadf3797 (diff) | |
download | qtquickcontrols-5dc805c86077ee9cd10af530f802fdda879cfb6a.tar.gz |
Controls: Fixed support for Keys attached property on controls allowing text input
By forwarding key events from the internal control.
It includes TextField, TextArea, ComboBox, SpinBox. The key events from
internal are Keys.forwardTo controls, then user could customize their
own behavior for those controls.
Autotest are included.
[ChangeLog][QtQuickControls] Fixed support for Keys attached property on
controls allowing text input, by forwarding key events from the internal
control.
Task-number: QTBUG-33493
Task-number: QTBUG-34101
Task-number: QTBUG-35763
Change-Id: I00ea131160e55048b34fe0713e1ee02ff9472f05
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'tests/auto/controls/data/tst_combobox.qml')
-rw-r--r-- | tests/auto/controls/data/tst_combobox.qml | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index 6758c982..4d5117fb 100644 --- a/tests/auto/controls/data/tst_combobox.qml +++ b/tests/auto/controls/data/tst_combobox.qml @@ -697,5 +697,37 @@ TestCase { comboBox.destroy() } } + + function test_keys() { + var component = Qt.createComponent("combobox/cb_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) + + verify(control1.gotit === false) + verify(control1.editText === "0") + + keyPress(Qt.Key_A) + verify(control1.activeFocus) + verify(control1.gotit === false) + verify(control1.editText === "0a") + + keyPress(Qt.Key_B) + verify(control1.activeFocus) + verify(control1.gotit === true) + verify(control1.editText === "0a") + + keyPress(Qt.Key_B) + verify(control1.activeFocus) + verify(control1.gotit === true) + verify(control1.editText === "0ab") + + test.destroy() + } } } |