diff options
author | Caroline Chao <caroline.chao@digia.com> | 2013-04-02 10:26:52 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-03 09:52:13 +0200 |
commit | 752d32214f2b25786ab8daf9e34eefc771cb7565 (patch) | |
tree | 20f1febe1f92cf20baadf3011a26ef6635da6239 /tests/auto/controls/data/tst_textarea.qml | |
parent | 8e83a5747029b567a302b59b0c9b957f39b73e5e (diff) | |
download | qtquickcontrols-752d32214f2b25786ab8daf9e34eefc771cb7565.tar.gz |
Tests: Add test for activeFocusOnPress property
For
- SpinBox
- TextField
- TextArea
- ToolButton
- Button
- CheckBox
- RadioButton
- Slider
Change-Id: I36c82c5058cfc9493d9fdb8c96c6612b1f387c0f
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'tests/auto/controls/data/tst_textarea.qml')
-rw-r--r-- | tests/auto/controls/data/tst_textarea.qml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_textarea.qml b/tests/auto/controls/data/tst_textarea.qml index 27f68a1a..945b8aa4 100644 --- a/tests/auto/controls/data/tst_textarea.qml +++ b/tests/auto/controls/data/tst_textarea.qml @@ -41,6 +41,11 @@ import QtQuick 2.1 import QtTest 1.0 +Item { + id: container + width: 300 + height: 300 + TestCase { id: testCase name: "Tests_TextArea" @@ -59,4 +64,17 @@ TestCase { textarea.append("name"); compare(textarea.text, "my\nname") } + + function test_activeFocusOnPress(){ + var control = Qt.createQmlObject('import QtQuick.Controls 1.0; TextArea {x: 20; y: 20; width: 100; height: 50}', container, '') + control.activeFocusOnPress = false + verify(!control.activeFocus) + mouseClick(control, 30, 30) + verify(!control.activeFocus) + control.activeFocusOnPress = true + verify(!control.activeFocus) + mouseClick(control, 30, 30) + verify(control.activeFocus) + } +} } |