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.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/examples/animation/stickman/lifecycle.cpp b/examples/animation/stickman/lifecycle.cpp
index e67b32d..67dd209 100644
--- a/examples/animation/stickman/lifecycle.cpp
+++ b/examples/animation/stickman/lifecycle.cpp
@@ -70,14 +70,12 @@ LifeCycle::LifeCycle(StickMan *stickMan, GraphicsView *keyReceiver)
// Set up intial state graph
m_machine = new QStateMachine();
- m_machine->setGlobalRestorePolicy(QState::RestoreProperties);
m_alive = new QState(m_machine->rootState());
m_alive->setObjectName("alive");
// Make it blink when lightning strikes before entering dead animation
QState *lightningBlink = new QState(m_machine->rootState());
- lightningBlink->setRestorePolicy(QState::DoNotRestoreProperties);
lightningBlink->assignProperty(m_stickMan->scene(), "backgroundBrush", Qt::white);
lightningBlink->assignProperty(m_stickMan, "penColor", Qt::black);
lightningBlink->assignProperty(m_stickMan, "fillColor", Qt::white);
@@ -90,7 +88,6 @@ LifeCycle::LifeCycle(StickMan *stickMan, GraphicsView *keyReceiver)
QObject::connect(lightningBlink, SIGNAL(exited()), timer, SLOT(stop()));
m_dead = new QState(m_machine->rootState());
- m_dead->setRestorePolicy(QState::DoNotRestoreProperties);
m_dead->assignProperty(m_stickMan->scene(), "backgroundBrush", Qt::black);
m_dead->assignProperty(m_stickMan, "penColor", Qt::white);
m_dead->assignProperty(m_stickMan, "fillColor", Qt::black);
@@ -110,15 +107,6 @@ LifeCycle::LifeCycle(StickMan *stickMan, GraphicsView *keyReceiver)
m_machine->setInitialState(m_alive);
}
-void LifeCycle::setResetKey(Qt::Key resetKey)
-{
- // When resetKey is pressed, enter the idle state and do a restoration animation
- // (requires no animation pointer, since no property is being set in the idle state)
- KeyPressTransition *trans = new KeyPressTransition(m_keyReceiver, resetKey, m_idle);
- trans->addAnimation(m_animationGroup);
- m_alive->addTransition(trans);
-}
-
void LifeCycle::setDeathAnimation(const QString &fileName)
{
QState *deathAnimation = makeState(m_dead, fileName);