aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-12-08 17:31:00 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-12-09 16:27:23 +0000
commitd1d3438f59a96f2263076d41d82a99e7269b4159 (patch)
tree6f04e7858234be45239771c9ed88bb4849000a18 /tests/auto
parente20e63a0b7d835fce16d41599dd69d348d5648b2 (diff)
StackView: fix property initialization
When pushing a url or component, ensure that properties passed to push() are initialized during the incubation. When pushing an item, the properties are set the same way than before, at stack element initialization phase. Change-Id: I19ca10baae43857e1349486059a3317d68d3b2d4 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/controls/data/tst_stackview.qml19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_stackview.qml b/tests/auto/controls/data/tst_stackview.qml
index 1cd12af3..6869ddac 100644
--- a/tests/auto/controls/data/tst_stackview.qml
+++ b/tests/auto/controls/data/tst_stackview.qml
@@ -757,4 +757,23 @@ TestCase {
control.destroy()
}
+
+ Component {
+ id: rectangle
+ Rectangle {
+ property color initialColor
+ Component.onCompleted: initialColor = color
+ }
+ }
+
+ function test_properties() {
+ var control = stackView.createObject(testCase)
+ verify(control)
+
+ var rect = control.push(rectangle, {color: "#ff0000"})
+ compare(rect.color, "#ff0000")
+ compare(rect.initialColor, "#ff0000")
+
+ control.destroy()
+ }
}