diff options
Diffstat (limited to 'src/declarative/util/qdeclarativestategroup.cpp')
-rw-r--r-- | src/declarative/util/qdeclarativestategroup.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/declarative/util/qdeclarativestategroup.cpp b/src/declarative/util/qdeclarativestategroup.cpp index df16c16fa2..4f9593011b 100644 --- a/src/declarative/util/qdeclarativestategroup.cpp +++ b/src/declarative/util/qdeclarativestategroup.cpp @@ -474,15 +474,17 @@ void QDeclarativeStateGroupPrivate::setCurrentStateInternal(const QString &state } if (oldState == 0 || newState == 0) { - if (!nullState) { nullState = new QDeclarativeState; QDeclarative_setParent_noEvent(nullState, q); } + if (!nullState) { + nullState = new QDeclarativeState; + QDeclarative_setParent_noEvent(nullState, q); + nullState->setStateGroup(q); + } if (!oldState) oldState = nullState; if (!newState) newState = nullState; } - newState->apply(q, transition, oldState); - applyingState = false; - if (!transition) - static_cast<QDeclarativeStatePrivate*>(QObjectPrivate::get(newState))->complete(); + newState->apply(transition, oldState); + applyingState = false; //### consider removing this (don't allow state changes in transition) } QDeclarativeState *QDeclarativeStateGroup::findState(const QString &name) const @@ -503,6 +505,12 @@ void QDeclarativeStateGroup::removeState(QDeclarativeState *state) d->states.removeOne(state); } +void QDeclarativeStateGroup::stateAboutToComplete() +{ + Q_D(QDeclarativeStateGroup); + d->applyingState = false; +} + QT_END_NAMESPACE |