summaryrefslogtreecommitdiffstats
path: root/examples/animation
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-04-23 07:33:52 (GMT)
committerEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-04-23 07:33:52 (GMT)
commit44548c4e02061ec14ba126a857665593e1aca642 (patch)
tree2febcad530c1ef05317b64b1ff568ca243f91198 /examples/animation
parentf87641584424deed25e2abdadea08c3be94b9ce1 (diff)
downloadQt-44548c4e02061ec14ba126a857665593e1aca642.zip
Qt-44548c4e02061ec14ba126a857665593e1aca642.tar.gz
Qt-44548c4e02061ec14ba126a857665593e1aca642.tar.bz2
Remove specific RestorePolicy per state from example. The semantics for this
have changed to something which is more intuitive, so it is no longer useful for this case.
Diffstat (limited to 'examples/animation')
-rw-r--r--examples/animation/stickman/lifecycle.cpp12
-rw-r--r--examples/animation/stickman/lifecycle.h1
-rw-r--r--examples/animation/stickman/main.cpp2
3 files changed, 0 insertions, 15 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);
diff --git a/examples/animation/stickman/lifecycle.h b/examples/animation/stickman/lifecycle.h
index 437e935..58372f4 100644
--- a/examples/animation/stickman/lifecycle.h
+++ b/examples/animation/stickman/lifecycle.h
@@ -17,7 +17,6 @@ public:
~LifeCycle();
void setDeathAnimation(const QString &fileName);
- void setResetKey(Qt::Key key);
void addActivity(const QString &fileName, Qt::Key key);
void start();
diff --git a/examples/animation/stickman/main.cpp b/examples/animation/stickman/main.cpp
index 62860ec..8fc0077 100644
--- a/examples/animation/stickman/main.cpp
+++ b/examples/animation/stickman/main.cpp
@@ -23,7 +23,6 @@ int main(int argc, char **argv)
"<li>Press <font color=\"purple\">J</font> to make the stickman jump.</li>"
"<li>Press <font color=\"purple\">D</font> to make the stickman dance.</li>"
"<li>Press <font color=\"purple\">C</font> to make him chill out.</li>"
- "<li>Press <font color=\"purple\">Return</font> to make him return to his original position.</li>"
"<li>When you are done, press <font color=\"purple\">Escape</font>.</li>"
"</i></p>"
"<p>If he is unlucky, the stickman will get struck by lightning, and never jump, dance or chill out again."
@@ -46,7 +45,6 @@ int main(int argc, char **argv)
view->setSceneRect(scene->sceneRect());
LifeCycle *cycle = new LifeCycle(stickMan, view);
- cycle->setResetKey(Qt::Key_Return);
cycle->setDeathAnimation("animations/dead");
cycle->addActivity("animations/jumping", Qt::Key_J);