summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine/qstate.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-11-03 15:29:58 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-11-03 15:29:58 (GMT)
commitbf2ba79d1cdc0d5347d394a892bee287bc84fb81 (patch)
treeb6032f84dbad1fc1c4dea3c66a943aae5e560c84 /src/corelib/statemachine/qstate.cpp
parenta4e7db378ecd11bc858f76beb33c56ccebef6308 (diff)
parentddd1c40712a6a50b0574341087118fe4db67c3b2 (diff)
downloadQt-bf2ba79d1cdc0d5347d394a892bee287bc84fb81.zip
Qt-bf2ba79d1cdc0d5347d394a892bee287bc84fb81.tar.gz
Qt-bf2ba79d1cdc0d5347d394a892bee287bc84fb81.tar.bz2
Merge branch 'statemachine-api-changes' into 4.6
Conflicts: doc/src/frameworks-technologies/statemachine.qdoc src/corelib/statemachine/qstatemachine.cpp
Diffstat (limited to 'src/corelib/statemachine/qstate.cpp')
-rw-r--r--src/corelib/statemachine/qstate.cpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp
index 5dc310b..cf718a5 100644
--- a/src/corelib/statemachine/qstate.cpp
+++ b/src/corelib/statemachine/qstate.cpp
@@ -140,10 +140,10 @@ void QStatePrivate::emitFinished()
emit q->finished();
}
-void QStatePrivate::emitPolished()
+void QStatePrivate::emitPropertiesAssigned()
{
Q_Q(QState);
- emit q->polished();
+ emit q->propertiesAssigned();
}
/*!
@@ -229,7 +229,7 @@ QList<QAbstractTransition*> QStatePrivate::transitions() const
Instructs this state to set the property with the given \a name of the given
\a object to the given \a value when the state is entered.
- \sa polished()
+ \sa propertiesAssigned()
*/
void QState::assignProperty(QObject *object, const char *name,
const QVariant &value)
@@ -287,15 +287,14 @@ void QState::setErrorState(QAbstractState *state)
/*!
Adds the given \a transition. The transition has this state as the source.
- This state takes ownership of the transition. If the transition is successfully
- added, the function will return the \a transition pointer. Otherwise it will return null.
+ This state takes ownership of the transition.
*/
-QAbstractTransition *QState::addTransition(QAbstractTransition *transition)
+void QState::addTransition(QAbstractTransition *transition)
{
Q_D(QState);
if (!transition) {
qWarning("QState::addTransition: cannot add null transition");
- return 0;
+ return ;
}
transition->setParent(this);
@@ -304,18 +303,17 @@ QAbstractTransition *QState::addTransition(QAbstractTransition *transition)
QAbstractState *t = targets.at(i).data();
if (!t) {
qWarning("QState::addTransition: cannot add transition to null state");
- return 0;
+ return ;
}
if ((QAbstractStatePrivate::get(t)->machine() != d->machine())
&& QAbstractStatePrivate::get(t)->machine() && d->machine()) {
qWarning("QState::addTransition: cannot add transition "
"to a state in a different state machine");
- return 0;
+ return ;
}
}
if (machine() != 0 && machine()->configuration().contains(this))
QStateMachinePrivate::get(machine())->registerTransitions(this);
- return transition;
}
/*!
@@ -380,7 +378,8 @@ QAbstractTransition *QState::addTransition(QAbstractState *target)
return 0;
}
UnconditionalTransition *trans = new UnconditionalTransition(target);
- return addTransition(trans);
+ addTransition(trans);
+ return trans;
}
/*!
@@ -493,9 +492,15 @@ bool QState::event(QEvent *e)
*/
/*!
- \fn QState::polished()
+ \fn QState::propertiesAssigned()
+
+ This signal is emitted when all properties have been assigned their final value. If the state
+ assigns a value to one or more properties for which an animation exists (either set on the
+ transition or as a default animation on the state machine), then the signal will not be emitted
+ until all such animations have finished playing.
- This signal is emitted when all properties have been assigned their final value.
+ If there are no relevant animations, or no property assignments defined for the state, then
+ the signal will be emitted immediately before the state is entered.
\sa QState::assignProperty(), QAbstractTransition::addAnimation()
*/