aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qdeclarativestategroup.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2011-08-19 10:14:59 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-19 03:53:11 +0200
commit9ed7790fd828f1dfa51a05326620e538076297b1 (patch)
treeacd3825c454471b005255197d5af560a6ccdc2e0 /src/declarative/util/qdeclarativestategroup.cpp
parentc47025eab4276b4e1b0181b92e53ab4f7e3ae6aa (diff)
Internal state class refactoring.
Change-Id: I6e5fe3fa4459f99a50e3aa79c3a87106600f083a Reviewed-on: http://codereview.qt.nokia.com/3231 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Charles Yin <charles.yin@nokia.com>
Diffstat (limited to 'src/declarative/util/qdeclarativestategroup.cpp')
-rw-r--r--src/declarative/util/qdeclarativestategroup.cpp18
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