summaryrefslogtreecommitdiffstats
path: root/examples/statemachine
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-05-14 13:08:03 (GMT)
committerEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-05-14 13:08:03 (GMT)
commit17d8f734c038705f7f8196dfe5e8902c808a4945 (patch)
treeb6ac1d09fbe41d4d486e4fe9fe7ecb58dc7c209a /examples/statemachine
parentededfad305258f9f450b314d9e2d53a6905bc6d0 (diff)
downloadQt-17d8f734c038705f7f8196dfe5e8902c808a4945.zip
Qt-17d8f734c038705f7f8196dfe5e8902c808a4945.tar.gz
Qt-17d8f734c038705f7f8196dfe5e8902c808a4945.tar.bz2
Make QAbstractTransition::eventTest() non-const
We decided to remove the const of the eventTest() since some transitions have dynamic conditions and need to update when eventTest() is called.
Diffstat (limited to 'examples/statemachine')
-rw-r--r--examples/statemachine/factorial/main.cpp4
-rw-r--r--examples/statemachine/pingpong/main.cpp4
-rw-r--r--examples/statemachine/tankgame/gameovertransition.cpp2
-rw-r--r--examples/statemachine/tankgame/gameovertransition.h4
-rw-r--r--examples/statemachine/tankgameplugins/seek_ai/seek_ai.h6
5 files changed, 10 insertions, 10 deletions
diff --git a/examples/statemachine/factorial/main.cpp b/examples/statemachine/factorial/main.cpp
index ae5928f..1065eb8 100644
--- a/examples/statemachine/factorial/main.cpp
+++ b/examples/statemachine/factorial/main.cpp
@@ -100,7 +100,7 @@ public:
: QSignalTransition(fact, SIGNAL(xChanged(int))), m_fact(fact)
{}
- virtual bool eventTest(QEvent *e) const
+ virtual bool eventTest(QEvent *e)
{
if (!QSignalTransition::eventTest(e))
return false;
@@ -130,7 +130,7 @@ public:
: QSignalTransition(fact, SIGNAL(xChanged(int))), m_fact(fact)
{}
- virtual bool eventTest(QEvent *e) const
+ virtual bool eventTest(QEvent *e)
{
if (!QSignalTransition::eventTest(e))
return false;
diff --git a/examples/statemachine/pingpong/main.cpp b/examples/statemachine/pingpong/main.cpp
index db66bfd..331627e 100644
--- a/examples/statemachine/pingpong/main.cpp
+++ b/examples/statemachine/pingpong/main.cpp
@@ -86,7 +86,7 @@ public:
PongTransition() {}
protected:
- virtual bool eventTest(QEvent *e) const {
+ virtual bool eventTest(QEvent *e) {
return (e->type() == QEvent::User+3);
}
virtual void onTransition(QEvent *)
@@ -104,7 +104,7 @@ public:
PingTransition() {}
protected:
- virtual bool eventTest(QEvent *e) const {
+ virtual bool eventTest(QEvent *e) {
return (e->type() == QEvent::User+2);
}
virtual void onTransition(QEvent *)
diff --git a/examples/statemachine/tankgame/gameovertransition.cpp b/examples/statemachine/tankgame/gameovertransition.cpp
index 21c3510..cec786e 100644
--- a/examples/statemachine/tankgame/gameovertransition.cpp
+++ b/examples/statemachine/tankgame/gameovertransition.cpp
@@ -22,7 +22,7 @@ void GameOverTransition::addTankItem(TankItem *tankItem)
connect(tankItem, SIGNAL(aboutToBeDestroyed()), mapper, SLOT(map()));
}
-bool GameOverTransition::eventTest(QEvent *e) const
+bool GameOverTransition::eventTest(QEvent *e)
{
bool ret = QSignalTransition::eventTest(e);
diff --git a/examples/statemachine/tankgame/gameovertransition.h b/examples/statemachine/tankgame/gameovertransition.h
index 53c9b86..9a86b83 100644
--- a/examples/statemachine/tankgame/gameovertransition.h
+++ b/examples/statemachine/tankgame/gameovertransition.h
@@ -13,10 +13,10 @@ public:
void addTankItem(TankItem *tankItem);
protected:
- bool eventTest(QEvent *event) const;
+ bool eventTest(QEvent *event);
private:
- mutable QList<TankItem *> m_tankItems;
+ QList<TankItem *> m_tankItems;
};
#endif
diff --git a/examples/statemachine/tankgameplugins/seek_ai/seek_ai.h b/examples/statemachine/tankgameplugins/seek_ai/seek_ai.h
index 597f8595..9d4aabc 100644
--- a/examples/statemachine/tankgameplugins/seek_ai/seek_ai.h
+++ b/examples/statemachine/tankgameplugins/seek_ai/seek_ai.h
@@ -81,7 +81,7 @@ public:
}
protected:
- bool eventTest(QEvent *event) const
+ bool eventTest(QEvent *event)
{
bool b = QSignalTransition::eventTest(event);
if (b) {
@@ -105,7 +105,7 @@ protected:
}
private:
- mutable QLineF m_lastLine;
+ QLineF m_lastLine;
QObject *m_tank;
QState *m_turnTo;
};
@@ -180,7 +180,7 @@ public:
}
protected:
- bool eventTest(QEvent *event) const
+ bool eventTest(QEvent *event)
{
bool b = QSignalTransition::eventTest(event);
if (b) {