summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/declarative/util/qmlstateoperations.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/declarative/util/qmlstateoperations.cpp b/src/declarative/util/qmlstateoperations.cpp
index a9a5bd5..921aa6c 100644
--- a/src/declarative/util/qmlstateoperations.cpp
+++ b/src/declarative/util/qmlstateoperations.cpp
@@ -208,9 +208,12 @@ void QmlParentChange::saveOriginals()
d->origParent = d->target->parentItem();
- //try to determine the items original stack position so we can restore it
- if (!d->origParent)
+ if (!d->origParent) {
d->origStackBefore = 0;
+ return;
+ }
+
+ //try to determine the item's original stack position so we can restore it
int siblingIndex = ((AccessibleFxItem*)d->target)->siblingIndex() + 1;
QList<QGraphicsItem*> children = d->origParent->childItems();
for (int i = 0; i < children.count(); ++i) {