summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2009-09-29 06:49:11 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2009-09-29 06:49:11 (GMT)
commitff6c8f9439630c2ea3bf78d5568a44521e915898 (patch)
treeff3fc149ebc6547dda412500aadeacbe568e2ceb /demos
parent6034fc5b4a15bab2ab65e4cc3963fe00bdcb415b (diff)
parentfd5269a9a80bf8b119086b3f326c72a332aba4e9 (diff)
downloadQt-ff6c8f9439630c2ea3bf78d5568a44521e915898.zip
Qt-ff6c8f9439630c2ea3bf78d5568a44521e915898.tar.gz
Qt-ff6c8f9439630c2ea3bf78d5568a44521e915898.tar.bz2
Merge branch '4.6' of git@scm.dev.troll.no:qt/qt into 4.6
Diffstat (limited to 'demos')
-rw-r--r--demos/boxes/main.cpp7
-rw-r--r--demos/sub-attaq/states.cpp5
2 files changed, 6 insertions, 6 deletions
diff --git a/demos/boxes/main.cpp b/demos/boxes/main.cpp
index 557afc9..957f183 100644
--- a/demos/boxes/main.cpp
+++ b/demos/boxes/main.cpp
@@ -68,7 +68,7 @@ protected:
inline bool matchString(const char *extensionString, const char *subString)
{
int subStringLength = strlen(subString);
- return (strncmp(extensionString, subString, subStringLength) == 0)
+ return (strncmp(extensionString, subString, subStringLength) == 0)
&& ((extensionString[subStringLength] == ' ') || (extensionString[subStringLength] == '\0'));
}
@@ -137,11 +137,12 @@ int main(int argc, char **argv)
"This demo can be GPU and CPU intensive and may\n"
"work poorly or not at all on your system.");
+ widget->makeCurrent(); // The current context must be set before calling Scene's constructor
+ Scene scene(1024, 768, maxTextureSize);
GraphicsView view;
view.setViewport(widget);
view.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
- widget->makeCurrent(); // The current context must be set before calling Scene's constructor
- view.setScene(new Scene(1024, 768, maxTextureSize));
+ view.setScene(&scene);
view.show();
return app.exec();
diff --git a/demos/sub-attaq/states.cpp b/demos/sub-attaq/states.cpp
index 4a9d845..10c173e 100644
--- a/demos/sub-attaq/states.cpp
+++ b/demos/sub-attaq/states.cpp
@@ -54,7 +54,6 @@
#include <QtGui/QGraphicsView>
#include <QtCore/QStateMachine>
#include <QtGui/QKeyEventTransition>
-#include <QtCore/QSignalEvent>
#include <QtCore/QFinalState>
PlayState::PlayState(GraphicsScene *scene, QState *parent)
@@ -295,7 +294,7 @@ bool UpdateScoreTransition::eventTest(QEvent *event)
if (!QSignalTransition::eventTest(event))
return false;
else {
- QSignalEvent *se = static_cast<QSignalEvent*>(event);
+ QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(event);
game->score += se->arguments().at(0).toInt();
scene->progressItem->setScore(game->score);
return true;
@@ -315,7 +314,7 @@ bool WinTransition::eventTest(QEvent *event)
if (!QSignalTransition::eventTest(event))
return false;
else {
- QSignalEvent *se = static_cast<QSignalEvent*>(event);
+ QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(event);
game->score += se->arguments().at(0).toInt();
scene->progressItem->setScore(game->score);
return true;