diff options
author | Liang Qi <liang.qi@digia.com> | 2013-11-14 10:35:13 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-22 13:02:21 +0100 |
commit | 20db3ac1e11d528ab2a924fd10764d903e8c1b4b (patch) | |
tree | 8a4e436239c721904eccb8c619ba3e2db84efcc8 /tests/auto/controls/data/tst_textfield.qml | |
parent | 692211670b377014c4dcf7b6819723bbeb2ffa66 (diff) | |
download | qtquickcontrols-20db3ac1e11d528ab2a924fd10764d903e8c1b4b.tar.gz |
TextField: add editingFinished signal
Autotest is included.
Task-number: QTBUG-34780
Change-Id: I19e73ca0c988a9d294aca52f9c0eabb9274f40d7
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'tests/auto/controls/data/tst_textfield.qml')
-rw-r--r-- | tests/auto/controls/data/tst_textfield.qml | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_textfield.qml b/tests/auto/controls/data/tst_textfield.qml index 6a176997..a5dc2d87 100644 --- a/tests/auto/controls/data/tst_textfield.qml +++ b/tests/auto/controls/data/tst_textfield.qml @@ -356,5 +356,35 @@ TestCase { verify(!control.control3.activeFocus) control.destroy() } + + function test_editingFinished() { + var component = Qt.createComponent("textfield/tf_editingfinished.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) + var control2 = test.control2 + verify(control2 !== null) + + control1.forceActiveFocus() + verify(control1.activeFocus) + verify(!control2.activeFocus) + + verify(control1.myeditingfinished === false) + verify(control2.myeditingfinished === false) + + keyPress(Qt.Key_Tab) + verify(!control1.activeFocus) + verify(control2.activeFocus) + verify(control1.myeditingfinished === true) + + keyPress(Qt.Key_Enter) + verify(!control1.activeFocus) + verify(control2.activeFocus) + verify(control2.myeditingfinished === true) + + test.destroy() + } } } |