summaryrefslogtreecommitdiffstats
path: root/examples/animation
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-05-14 13:53:44 (GMT)
committerEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-05-14 14:52:32 (GMT)
commit889316a3f57b57160e2a08fc41def774d56e288c (patch)
treefca1a08e8f48334afbab60a19319668c7bfaa1d8 /examples/animation
parent077c35c2fc4b41846e953c2e880ce1bff396a715 (diff)
downloadQt-889316a3f57b57160e2a08fc41def774d56e288c.zip
Qt-889316a3f57b57160e2a08fc41def774d56e288c.tar.gz
Qt-889316a3f57b57160e2a08fc41def774d56e288c.tar.bz2
Start work on docs for Stickman example
Diffstat (limited to 'examples/animation')
-rw-r--r--examples/animation/stickman/lifecycle.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/animation/stickman/lifecycle.cpp b/examples/animation/stickman/lifecycle.cpp
index 423d7ad..6b69a26 100644
--- a/examples/animation/stickman/lifecycle.cpp
+++ b/examples/animation/stickman/lifecycle.cpp
@@ -141,9 +141,10 @@ LifeCycle::LifeCycle(StickMan *stickMan, GraphicsView *keyReceiver)
m_alive->setInitialState(m_idle);
// Lightning strikes at random
+//! [0]
m_alive->addTransition(new LightningStrikesTransition(lightningBlink));
- //m_alive->addTransition(new KeyPressTransition(m_keyReceiver, Qt::Key_L, lightningBlink));
connectByAnimation(lightningBlink, m_dead, new QSignalTransition(timer, SIGNAL(timeout())));
+//! [0]
m_machine->setInitialState(m_alive);
}
@@ -159,8 +160,8 @@ void LifeCycle::start()
m_machine->start();
}
-void LifeCycle::connectByAnimation(QState *s1, QAbstractState *s2,
- QAbstractTransition *transition)
+//! [1]
+void LifeCycle::connectByAnimation(QState *s1, QAbstractState *s2, QAbstractTransition *transition)
{
if (transition == 0) {
transition = s1->addTransition(s2);
@@ -170,6 +171,7 @@ void LifeCycle::connectByAnimation(QState *s1, QAbstractState *s2,
}
transition->addAnimation(m_animationGroup);
}
+//! [1]
void LifeCycle::addActivity(const QString &fileName, Qt::Key key)
{