summaryrefslogtreecommitdiffstats
path: root/examples/animation
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/animation
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/animation')
-rw-r--r--examples/animation/moveblocks/main.cpp2
-rw-r--r--examples/animation/stickman/lifecycle.cpp4
-rw-r--r--examples/animation/sub-attaq/boat_p.h6
-rw-r--r--examples/animation/sub-attaq/states.cpp6
-rw-r--r--examples/animation/sub-attaq/states.h6
5 files changed, 12 insertions, 12 deletions
diff --git a/examples/animation/moveblocks/main.cpp b/examples/animation/moveblocks/main.cpp
index 06ed3dd..0ce07fc 100644
--- a/examples/animation/moveblocks/main.cpp
+++ b/examples/animation/moveblocks/main.cpp
@@ -95,7 +95,7 @@ public:
}
protected:
- virtual bool eventTest(QEvent *event) const
+ virtual bool eventTest(QEvent *event)
{
return (event->type() == QEvent::Type(StateSwitchEvent::StateSwitchType))
&& (static_cast<StateSwitchEvent *>(event)->rand() == m_rand);
diff --git a/examples/animation/stickman/lifecycle.cpp b/examples/animation/stickman/lifecycle.cpp
index b22af55..423d7ad 100644
--- a/examples/animation/stickman/lifecycle.cpp
+++ b/examples/animation/stickman/lifecycle.cpp
@@ -69,7 +69,7 @@ public:
{
}
- virtual bool eventTest(QEvent *e) const
+ virtual bool eventTest(QEvent *e)
{
if (QSignalTransition::eventTest(e)) {
QVariant key = static_cast<QSignalEvent*>(e)->arguments().at(0);
@@ -92,7 +92,7 @@ public:
startTimer(1000);
}
- virtual bool eventTest(QEvent *e) const
+ virtual bool eventTest(QEvent *e)
{
return QEventTransition::eventTest(e) && ((qrand() % 50) == 0);
}
diff --git a/examples/animation/sub-attaq/boat_p.h b/examples/animation/sub-attaq/boat_p.h
index 17fbe5c..6f03e48 100644
--- a/examples/animation/sub-attaq/boat_p.h
+++ b/examples/animation/sub-attaq/boat_p.h
@@ -67,7 +67,7 @@ public:
this->key = key;
}
protected:
- virtual bool eventTest(QEvent *event) const
+ virtual bool eventTest(QEvent *event)
{
Q_UNUSED(event);
if (!QKeyEventTransition::eventTest(event))
@@ -93,7 +93,7 @@ public:
this->key = key;
}
protected:
- virtual bool eventTest(QEvent *event) const
+ virtual bool eventTest(QEvent *event)
{
Q_UNUSED(event);
if (!QKeyEventTransition::eventTest(event))
@@ -131,7 +131,7 @@ public:
this->key = key;
}
protected:
- virtual bool eventTest(QEvent *event) const
+ virtual bool eventTest(QEvent *event)
{
Q_UNUSED(event);
if (!QKeyEventTransition::eventTest(event))
diff --git a/examples/animation/sub-attaq/states.cpp b/examples/animation/sub-attaq/states.cpp
index c6af924..7650b0f 100644
--- a/examples/animation/sub-attaq/states.cpp
+++ b/examples/animation/sub-attaq/states.cpp
@@ -281,7 +281,7 @@ UpdateScoreTransition::UpdateScoreTransition(GraphicsScene *scene, PlayState *ga
{
}
-bool UpdateScoreTransition::eventTest(QEvent *event) const
+bool UpdateScoreTransition::eventTest(QEvent *event)
{
if (!QSignalTransition::eventTest(event))
return false;
@@ -300,7 +300,7 @@ WinTransition::WinTransition(GraphicsScene *scene, PlayState *game, QAbstractSta
{
}
-bool WinTransition::eventTest(QEvent *event) const
+bool WinTransition::eventTest(QEvent *event)
{
if (!QSignalTransition::eventTest(event))
return false;
@@ -319,7 +319,7 @@ CustomSpaceTransition::CustomSpaceTransition(QWidget *widget, PlayState *game, Q
{
}
-bool CustomSpaceTransition::eventTest(QEvent *event) const
+bool CustomSpaceTransition::eventTest(QEvent *event)
{
Q_UNUSED(event);
if (!QKeyEventTransition::eventTest(event))
diff --git a/examples/animation/sub-attaq/states.h b/examples/animation/sub-attaq/states.h
index 27beb71..a1cb5ff 100644
--- a/examples/animation/sub-attaq/states.h
+++ b/examples/animation/sub-attaq/states.h
@@ -152,7 +152,7 @@ class UpdateScoreTransition : public QSignalTransition
public:
UpdateScoreTransition(GraphicsScene *scene, PlayState *game, QAbstractState *target);
protected:
- virtual bool eventTest(QEvent *event) const;
+ virtual bool eventTest(QEvent *event);
private:
PlayState * game;
GraphicsScene *scene;
@@ -164,7 +164,7 @@ class WinTransition : public QSignalTransition
public:
WinTransition(GraphicsScene *scene, PlayState *game, QAbstractState *target);
protected:
- virtual bool eventTest(QEvent *event) const;
+ virtual bool eventTest(QEvent *event);
private:
PlayState * game;
GraphicsScene *scene;
@@ -176,7 +176,7 @@ private:
public:
CustomSpaceTransition(QWidget *widget, PlayState *game, QEvent::Type type, int key);
protected:
- virtual bool eventTest(QEvent *event) const;
+ virtual bool eventTest(QEvent *event);
private:
PlayState *game;
int key;