summaryrefslogtreecommitdiffstats
path: root/examples/animation/stickman/lifecycle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/animation/stickman/lifecycle.cpp')
-rw-r--r--examples/animation/stickman/lifecycle.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/animation/stickman/lifecycle.cpp b/examples/animation/stickman/lifecycle.cpp
index 4abcdc2..8e9dbe1 100644
--- a/examples/animation/stickman/lifecycle.cpp
+++ b/examples/animation/stickman/lifecycle.cpp
@@ -159,10 +159,14 @@ void LifeCycle::start()
m_machine->start();
}
-void LifeCycle::addActivity(const QString &fileName, Qt::Key key)
+void LifeCycle::addActivity(const QString &fileName, Qt::Key key, QObject *sender, const char *signal)
{
QState *state = makeState(m_alive, fileName);
m_alive->addTransition(new KeyPressTransition(m_keyReceiver, key, state));
+
+ if((sender != NULL) || (signal != NULL)) {
+ m_alive->addTransition(sender, signal, state);
+ }
}
QState *LifeCycle::makeState(QState *parentState, const QString &animationFileName)