summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-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