summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorJoona Petrell <joona.t.petrell@nokia.com>2010-10-06 14:01:56 +1000
committerJoona Petrell <joona.t.petrell@nokia.com>2010-10-06 15:03:26 +1000
commit695b54e671b55bd8103dee8b30ee76309dbd26c1 (patch)
treeabf22c23b52d72c7c53343c269d7639baa6ae74a /demos
parent4647f24469ec93b3b66628472af5462fbe957439 (diff)
downloadqt4-tools-695b54e671b55bd8103dee8b30ee76309dbd26c1.tar.gz
Fix minehunt execution from QtDemo
Task-number: QTBUG-14250 Reviewed-by: Martin Jones
Diffstat (limited to 'demos')
-rw-r--r--demos/declarative/minehunt/main.cpp2
-rw-r--r--demos/declarative/minehunt/minehunt.pro1
-rw-r--r--demos/declarative/minehunt/minehunt.qrc20
-rw-r--r--demos/qtdemo/menumanager.cpp1
-rw-r--r--demos/qtdemo/xml/examples.xml2
5 files changed, 24 insertions, 2 deletions
diff --git a/demos/declarative/minehunt/main.cpp b/demos/declarative/minehunt/main.cpp
index 8bbaee9cfc..2b286eff50 100644
--- a/demos/declarative/minehunt/main.cpp
+++ b/demos/declarative/minehunt/main.cpp
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
canvas.setResizeMode(QDeclarativeView::SizeRootObjectToView);
#endif
canvas.engine()->rootContext()->setContextObject(game);
- canvas.setSource(QString("minehunt.qml"));
+ canvas.setSource(QString("qrc:minehunt.qml"));
QObject::connect(canvas.engine(), SIGNAL(quit()), &app, SLOT(quit()));
#ifdef Q_OS_SYMBIAN
diff --git a/demos/declarative/minehunt/minehunt.pro b/demos/declarative/minehunt/minehunt.pro
index 7a491ab6fc..753ca4eb68 100644
--- a/demos/declarative/minehunt/minehunt.pro
+++ b/demos/declarative/minehunt/minehunt.pro
@@ -6,6 +6,7 @@ CONFIG += qt plugin
# Input
HEADERS += minehunt.h
SOURCES += main.cpp minehunt.cpp
+RESOURCES = minehunt.qrc
sources.files = minehunt.qml minehunt.pro MinehuntCore
sources.path = $$[QT_INSTALL_DEMOS]/declarative/minehunt
diff --git a/demos/declarative/minehunt/minehunt.qrc b/demos/declarative/minehunt/minehunt.qrc
new file mode 100644
index 0000000000..fa8e27d383
--- /dev/null
+++ b/demos/declarative/minehunt/minehunt.qrc
@@ -0,0 +1,20 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>minehunt.qml</file>
+ <file>MinehuntCore/Explosion.qml</file>
+ <file>MinehuntCore/Tile.qml</file>
+ <file>MinehuntCore/qmldir</file>
+ <file>MinehuntCore/pics/background.png</file>
+ <file>MinehuntCore/pics/back.png</file>
+ <file>MinehuntCore/pics/bomb-color.png</file>
+ <file>MinehuntCore/pics/bomb.png</file>
+ <file>MinehuntCore/pics/face-sad.png</file>
+ <file>MinehuntCore/pics/face-smile-big.png</file>
+ <file>MinehuntCore/pics/face-smile.png</file>
+ <file>MinehuntCore/pics/flag-color.png</file>
+ <file>MinehuntCore/pics/flag.png</file>
+ <file>MinehuntCore/pics/front.png</file>
+ <file>MinehuntCore/pics/quit.png</file>
+ <file>MinehuntCore/pics/star.png</file>
+</qresource>
+</RCC>
diff --git a/demos/qtdemo/menumanager.cpp b/demos/qtdemo/menumanager.cpp
index fe3c5aafbf..ea9146eb5b 100644
--- a/demos/qtdemo/menumanager.cpp
+++ b/demos/qtdemo/menumanager.cpp
@@ -518,6 +518,7 @@ QString MenuManager::resolveExeFile(const QString &name)
dir.cd(dirName);
dir.cd(fileName);
+ fileName = fileName.split("/").last();
QFile unixFile(dir.path() + "/" + fileName);
if (unixFile.exists()) return unixFile.fileName();
QFile winR(dir.path() + "\\release\\" + fileName + ".exe");
diff --git a/demos/qtdemo/xml/examples.xml b/demos/qtdemo/xml/examples.xml
index 0ab048e0a1..27f72bbeb7 100644
--- a/demos/qtdemo/xml/examples.xml
+++ b/demos/qtdemo/xml/examples.xml
@@ -18,7 +18,7 @@
<example filename="boxes" name="Boxes" />
<example filename="sub-attaq" name="Sub-attaq" />
<example filename="spectrum" name="Spectrum Analyzer" />
- <example filename="declarative/minehunt" name="Minehunt" executable="false" qml="true"/>
+ <example filename="declarative/minehunt" name="Minehunt"/>
<example filename="declarative/snake" name="Snake" executable="false" qml="true"/>
<example filename="deform" name="Vector Deformation" />
<example filename="books" name="Books" />