summaryrefslogtreecommitdiffstats
path: root/examples/animation
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-08-03 10:35:37 +0200
committerKent Hansen <khansen@trolltech.com>2009-08-03 10:40:30 +0200
commitacd156649b1083aeeb400fe8fdbbf4e55ada4bed (patch)
treee74b2486cacc4b318b5c0533360ab03e1923a11d /examples/animation
parent45005c68c6effa41108ef55cd10a84f5977f79a0 (diff)
remove constructors that are not useful
The constructors that take a list of target states produce hard-to-read code, and they're rarely useful in practice since 99% of transitions take a single target state; so it's better to enforce that setTarget{State,States}() be used instead.
Diffstat (limited to 'examples/animation')
-rw-r--r--examples/animation/stickman/lifecycle.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/animation/stickman/lifecycle.cpp b/examples/animation/stickman/lifecycle.cpp
index c761d87a30..700916d223 100644
--- a/examples/animation/stickman/lifecycle.cpp
+++ b/examples/animation/stickman/lifecycle.cpp
@@ -56,8 +56,9 @@ public:
{
}
KeyPressTransition(GraphicsView *receiver, Qt::Key key, QAbstractState *target)
- : QSignalTransition(receiver, SIGNAL(keyPressed(int)), QList<QAbstractState*>() << target), m_key(key)
+ : QSignalTransition(receiver, SIGNAL(keyPressed(int))), m_key(key)
{
+ setTargetState(target);
}
virtual bool eventTest(QEvent *e)
@@ -78,8 +79,9 @@ class LightningStrikesTransition: public QEventTransition
{
public:
LightningStrikesTransition(QAbstractState *target)
- : QEventTransition(this, QEvent::Timer, QList<QAbstractState*>() << target)
+ : QEventTransition(this, QEvent::Timer)
{
+ setTargetState(target);
qsrand((uint)QDateTime::currentDateTime().toTime_t());
startTimer(1000);
}