diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-10-11 00:04:55 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-10-11 13:05:28 +0000 |
commit | aa634f86429ad15fced74a5a65e7d170b5e7e9ff (patch) | |
tree | 21e24400e65ff10e5f45a6b93230de77b9f36aa1 /tests/auto/controls/data/tst_stackview.qml | |
parent | 9d4c6278217fecefa15c52073f8de0e6f0e7700d (diff) |
Fix StackView attached property
The attached properties weren't initialized at all for the initial
item. Furthermore, the properties were initialized lazily, which
made them work for imperative tests, but not correctly in bindings.
Change-Id: I783c406dcf4e1cf27a6b4e6ddd43214cb06a3c7a
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'tests/auto/controls/data/tst_stackview.qml')
-rw-r--r-- | tests/auto/controls/data/tst_stackview.qml | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_stackview.qml b/tests/auto/controls/data/tst_stackview.qml index f54cd9ae..3dc6d0c9 100644 --- a/tests/auto/controls/data/tst_stackview.qml +++ b/tests/auto/controls/data/tst_stackview.qml @@ -540,4 +540,39 @@ TestCase { control.destroy() } + + Component { + id: attachedItem + Item { + property int index: StackView.index + property StackView view: StackView.view + property int status: StackView.status + } + } + + function test_attached() { + var control = stackView.createObject(testCase, {initialItem: attachedItem}) + + compare(control.get(0).index, 0) + compare(control.get(0).view, control) + compare(control.get(0).status, StackView.Active) + + control.push(attachedItem, StackView.Immediate) + + compare(control.get(0).index, 0) + compare(control.get(0).view, control) + compare(control.get(0).status, StackView.Inactive) + + compare(control.get(1).index, 1) + compare(control.get(1).view, control) + compare(control.get(1).status, StackView.Active) + + control.pop(StackView.Immediate) + + compare(control.get(0).index, 0) + compare(control.get(0).view, control) + compare(control.get(0).status, StackView.Active) + + control.destroy() + } } |