aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates
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 /src/templates
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 'src/templates')
-rw-r--r--src/templates/qquickstackview_p.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/templates/qquickstackview_p.cpp b/src/templates/qquickstackview_p.cpp
index ffd9934e..dbcb186a 100644
--- a/src/templates/qquickstackview_p.cpp
+++ b/src/templates/qquickstackview_p.cpp
@@ -139,16 +139,19 @@ bool QQuickStackElement::load(QQuickStackView *parent)
delete incubator;
incubator = new QQuickStackIncubator(this);
component->create(*incubator, context);
+ } else {
+ initialize();
}
- initialize();
return item;
}
void QQuickStackElement::incubate(QObject *object)
{
item = qmlobject_cast<QQuickItem *>(object);
- if (item)
+ if (item) {
QQmlEngine::setObjectOwnership(item, QQmlEngine::CppOwnership);
+ initialize();
+ }
}
void QQuickStackElement::initialize()