From 695b54e671b55bd8103dee8b30ee76309dbd26c1 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Wed, 6 Oct 2010 14:01:56 +1000 Subject: Fix minehunt execution from QtDemo Task-number: QTBUG-14250 Reviewed-by: Martin Jones --- demos/declarative/minehunt/main.cpp | 2 +- demos/declarative/minehunt/minehunt.pro | 1 + demos/declarative/minehunt/minehunt.qrc | 20 ++++++++++++++++++++ demos/qtdemo/menumanager.cpp | 1 + demos/qtdemo/xml/examples.xml | 2 +- 5 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 demos/declarative/minehunt/minehunt.qrc diff --git a/demos/declarative/minehunt/main.cpp b/demos/declarative/minehunt/main.cpp index 8bbaee9..2b286ef 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 7a491ab..753ca4e 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 0000000..fa8e27d --- /dev/null +++ b/demos/declarative/minehunt/minehunt.qrc @@ -0,0 +1,20 @@ + + + minehunt.qml + MinehuntCore/Explosion.qml + MinehuntCore/Tile.qml + MinehuntCore/qmldir + MinehuntCore/pics/background.png + MinehuntCore/pics/back.png + MinehuntCore/pics/bomb-color.png + MinehuntCore/pics/bomb.png + MinehuntCore/pics/face-sad.png + MinehuntCore/pics/face-smile-big.png + MinehuntCore/pics/face-smile.png + MinehuntCore/pics/flag-color.png + MinehuntCore/pics/flag.png + MinehuntCore/pics/front.png + MinehuntCore/pics/quit.png + MinehuntCore/pics/star.png + + diff --git a/demos/qtdemo/menumanager.cpp b/demos/qtdemo/menumanager.cpp index fe3c5aa..ea9146e 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 0ab048e..27f72bb 100644 --- a/demos/qtdemo/xml/examples.xml +++ b/demos/qtdemo/xml/examples.xml @@ -18,7 +18,7 @@ - + -- cgit v0.12