summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-09-02 14:15:05 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-09-02 14:16:24 (GMT)
commit6e7d21677621eb7855174bf370cc3047e9e0a4ba (patch)
tree4cfbce80243ed58b9555d25329db08f417ca9e7f
parent3df6f4c0adf7738e631c2d823dc07a5358d3de66 (diff)
downloadQt-6e7d21677621eb7855174bf370cc3047e9e0a4ba.zip
Qt-6e7d21677621eb7855174bf370cc3047e9e0a4ba.tar.gz
Qt-6e7d21677621eb7855174bf370cc3047e9e0a4ba.tar.bz2
make the animations file in stickman demo be resources
This helps the demo find the files more easily Task-number: 260628 Reviewed-by: eskil
-rw-r--r--examples/animation/stickman/main.cpp9
-rw-r--r--examples/animation/stickman/stickman.pro2
-rw-r--r--examples/animation/stickman/stickman.qrc8
3 files changed, 14 insertions, 5 deletions
diff --git a/examples/animation/stickman/main.cpp b/examples/animation/stickman/main.cpp
index 2b9e63c..8fafd94 100644
--- a/examples/animation/stickman/main.cpp
+++ b/examples/animation/stickman/main.cpp
@@ -50,6 +50,7 @@
int main(int argc, char **argv)
{
+ Q_INIT_RESOURCE(stickman);
QApplication app(argc, argv);
StickMan *stickMan = new StickMan;
@@ -86,11 +87,11 @@ int main(int argc, char **argv)
view->setSceneRect(scene->sceneRect());
LifeCycle *cycle = new LifeCycle(stickMan, view);
- cycle->setDeathAnimation("animations/dead");
+ cycle->setDeathAnimation(":/animations/dead");
- cycle->addActivity("animations/jumping", Qt::Key_J);
- cycle->addActivity("animations/dancing", Qt::Key_D);
- cycle->addActivity("animations/chilling", Qt::Key_C);
+ cycle->addActivity(":/animations/jumping", Qt::Key_J);
+ cycle->addActivity(":/animations/dancing", Qt::Key_D);
+ cycle->addActivity(":/animations/chilling", Qt::Key_C);
cycle->start();
return app.exec();
diff --git a/examples/animation/stickman/stickman.pro b/examples/animation/stickman/stickman.pro
index 7f8be33..487ff3a 100644
--- a/examples/animation/stickman/stickman.pro
+++ b/examples/animation/stickman/stickman.pro
@@ -10,7 +10,7 @@ SOURCES += main.cpp \
lifecycle.cpp \
graphicsview.cpp
-INCLUDEPATH += $$PWD
+RESOURCES += stickman.qrc
# install
target.path = $$[QT_INSTALL_EXAMPLES]/animation/stickman
diff --git a/examples/animation/stickman/stickman.qrc b/examples/animation/stickman/stickman.qrc
new file mode 100644
index 0000000..e5d66cf
--- /dev/null
+++ b/examples/animation/stickman/stickman.qrc
@@ -0,0 +1,8 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>animations/chilling</file>
+ <file>animations/dancing</file>
+ <file>animations/dead</file>
+ <file>animations/jumping</file>
+</qresource>
+</RCC> \ No newline at end of file