summaryrefslogtreecommitdiff
path: root/tests/auto/controls/data/tst_stackview.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-01-16 13:47:50 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-01-16 13:48:15 +0100
commit7497dc48e674ee155aeebf0986be5a929ce15877 (patch)
tree87f575b7ce612b7130b91fd4c9b4e3dc437ff612 /tests/auto/controls/data/tst_stackview.qml
parent46d983e08cdece92a62833dc74f37e2f11a66324 (diff)
parent5abfd7c00bc7ebfec2f059adc9bc22eb989ae10d (diff)
downloadqtquickcontrols-7497dc48e674ee155aeebf0986be5a929ce15877.tar.gz
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts: .qmake.conf tests/auto/controls/data/tst_stackview.qml Change-Id: I54b55d51452e812315f97bcdfd1a8e361a427f56
Diffstat (limited to 'tests/auto/controls/data/tst_stackview.qml')
-rw-r--r--tests/auto/controls/data/tst_stackview.qml27
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/auto/controls/data/tst_stackview.qml b/tests/auto/controls/data/tst_stackview.qml
index 9bbe5f4b..eaa8d14f 100644
--- a/tests/auto/controls/data/tst_stackview.qml
+++ b/tests/auto/controls/data/tst_stackview.qml
@@ -46,10 +46,12 @@ TestCase {
id: testCase
name: "Tests_StackView"
when: windowShown
+ visible: true
width: 400
height: 400
Item { id: anItem }
+ TextField { id: textField }
Component {
id: pageComponent
Item {}
@@ -57,7 +59,7 @@ TestCase {
Component {
id: stackComponent
- StackView {}
+ StackView { }
}
function test_stackview() {
@@ -77,5 +79,28 @@ TestCase {
var w = stack.width
testCase.width = w + 333
compare(stack.width, w)
+
+ stack.destroy()
+ }
+
+ function test_focus() {
+ var stack = stackComponent.createObject(testCase, {initialItem: anItem, width: testCase.width, height: testCase.height})
+ verify (stack !== null, "stackview created is null")
+ compare(stack.currentItem, anItem)
+
+ stack.forceActiveFocus()
+ verify(stack.activeFocus)
+
+ stack.push({item: textField, immediate: true})
+ compare(stack.currentItem, textField)
+ textField.forceActiveFocus()
+ verify(textField.activeFocus)
+
+ stack.pop({immediate: true})
+ compare(stack.currentItem, anItem)
+ verify(stack.activeFocus)
+ verify(!textField.activeFocus)
+
+ stack.destroy()
}
}