summaryrefslogtreecommitdiff
path: root/demos/declarative/minehunt
diff options
context:
space:
mode:
authorartoka <arto.katajasalo@digia.com>2011-11-17 15:50:14 +0100
committerCasper van Donderen <casper.vandonderen@nokia.com>2011-11-17 16:00:01 +0100
commit9b5bb1b8b1acd1deb2ce653ab1a4095a0e503306 (patch)
tree527b5bb26fc80dab7adf4fdaf3f80b65061a066f /demos/declarative/minehunt
parent00be4d1b8ffea62423413241ed5ec33c55ed5bce (diff)
downloadqt4-tools-9b5bb1b8b1acd1deb2ce653ab1a4095a0e503306.tar.gz
demos/declarative/minehunt example modifications
Modified the example to use centralized qmlapplicationviewer, removed duplicate files and modified project files according to the changes. Merge-request: 2719 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
Diffstat (limited to 'demos/declarative/minehunt')
-rw-r--r--demos/declarative/minehunt/MinehuntCore/qmldir2
-rw-r--r--demos/declarative/minehunt/main.cpp29
-rw-r--r--demos/declarative/minehunt/minehunt.pro49
-rw-r--r--demos/declarative/minehunt/minehunt.qmlproject6
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/Explosion.qml (renamed from demos/declarative/minehunt/MinehuntCore/Explosion.qml)1
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/Tile.qml (renamed from demos/declarative/minehunt/MinehuntCore/Tile.qml)0
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/back.png (renamed from demos/declarative/minehunt/MinehuntCore/pics/back.png)bin558 -> 558 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/background.png (renamed from demos/declarative/minehunt/MinehuntCore/pics/background.png)bin313930 -> 313930 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb-color.png (renamed from demos/declarative/minehunt/MinehuntCore/pics/bomb-color.png)bin284 -> 284 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb.png (renamed from demos/declarative/minehunt/MinehuntCore/pics/bomb.png)bin535 -> 535 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-sad.png (renamed from demos/declarative/minehunt/MinehuntCore/pics/face-sad.png)bin14844 -> 14844 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile-big.png (renamed from demos/declarative/minehunt/MinehuntCore/pics/face-smile-big.png)bin13810 -> 13810 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile.png (renamed from demos/declarative/minehunt/MinehuntCore/pics/face-smile.png)bin15408 -> 15408 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag-color.png (renamed from demos/declarative/minehunt/MinehuntCore/pics/flag-color.png)bin219 -> 219 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag.png (renamed from demos/declarative/minehunt/MinehuntCore/pics/flag.png)bin196 -> 196 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/front.png (renamed from demos/declarative/minehunt/MinehuntCore/pics/front.png)bin580 -> 580 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/quit.png (renamed from demos/declarative/minehunt/MinehuntCore/pics/quit.png)bin583 -> 583 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/star.png (renamed from demos/declarative/minehunt/MinehuntCore/pics/star.png)bin2677 -> 2677 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/minehunt.qml (renamed from demos/declarative/minehunt/minehunt.qml)2
19 files changed, 51 insertions, 38 deletions
diff --git a/demos/declarative/minehunt/MinehuntCore/qmldir b/demos/declarative/minehunt/MinehuntCore/qmldir
deleted file mode 100644
index 81980e09a6..0000000000
--- a/demos/declarative/minehunt/MinehuntCore/qmldir
+++ /dev/null
@@ -1,2 +0,0 @@
-Explosion 1.0 Explosion.qml
-Tile 1.0 Tile.qml
diff --git a/demos/declarative/minehunt/main.cpp b/demos/declarative/minehunt/main.cpp
index 9e7ab5f120..909de51938 100644
--- a/demos/declarative/minehunt/main.cpp
+++ b/demos/declarative/minehunt/main.cpp
@@ -39,33 +39,24 @@
**
****************************************************************************/
+#include "qmlapplicationviewer.h"
+#include "minehunt.h"
#include <QtGui/QApplication>
-#include <QtDeclarative/QDeclarativeView>
#include <QtDeclarative/QDeclarativeContext>
#include <QtDeclarative/QDeclarativeEngine>
-#include "minehunt.h"
-
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- QDeclarativeView canvas;
-
+ QmlApplicationViewer viewer;
+
qmlRegisterType<TileData>();
MinehuntGame* game = new MinehuntGame();
-
-#ifdef Q_OS_SYMBIAN
- canvas.setResizeMode(QDeclarativeView::SizeRootObjectToView);
-#endif
- canvas.engine()->rootContext()->setContextObject(game);
- canvas.setSource(QString("qrc:minehunt.qml"));
- QObject::connect(canvas.engine(), SIGNAL(quit()), &app, SLOT(quit()));
-
-#ifdef Q_OS_SYMBIAN
- canvas.showFullScreen();
-#else
- canvas.setGeometry(QRect(100, 100, 450, 450));
- canvas.show();
-#endif
+
+ viewer.engine()->rootContext()->setContextObject(game);
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/minehunt/minehunt.qml"));
+ viewer.showExpanded();
+
return app.exec();
}
diff --git a/demos/declarative/minehunt/minehunt.pro b/demos/declarative/minehunt/minehunt.pro
index d23bb05449..4eed9c1abe 100644
--- a/demos/declarative/minehunt/minehunt.pro
+++ b/demos/declarative/minehunt/minehunt.pro
@@ -1,17 +1,20 @@
-TEMPLATE = app
-TARGET = minehunt
-QT += declarative
+#TEMPLATE = app
+# Add more folders to ship with the application, here
+folder_01.source = qml/minehunt
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
-# Input
-HEADERS += minehunt.h
-SOURCES += main.cpp minehunt.cpp
-RESOURCES = minehunt.qrc
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
-sources.files = minehunt.qml minehunt.pro MinehuntCore
-sources.path = $$[QT_INSTALL_DEMOS]/declarative/minehunt
-target.path = $$[QT_INSTALL_DEMOS]/declarative/minehunt
+symbian:TARGET.UID3 = 0xE1CB8EBB
-INSTALLS = sources target
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
symbian:{
TARGET.EPOCALLOWDLLDATA = 1
@@ -20,4 +23,26 @@ symbian:{
qmlminehuntfiles.files = MinehuntCore minehunt.qml
DEPLOYMENT += qmlminehuntfiles
}
-
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# If your application uses the Qt Mobility libraries, uncomment the following
+# lines and add the respective components to the MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# Speed up launching on MeeGo/Harmattan when using applauncherd daemon
+# CONFIG += qdeclarative-boostable
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# Input
+HEADERS += minehunt.h
+SOURCES += main.cpp minehunt.cpp
+RESOURCES = minehunt.qrc
+
+# Please do not modify the following two lines. Required for deployment.
+include(../../../examples/tools/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/demos/declarative/minehunt/minehunt.qmlproject b/demos/declarative/minehunt/minehunt.qmlproject
index d4909f8685..1f8b659f54 100644
--- a/demos/declarative/minehunt/minehunt.qmlproject
+++ b/demos/declarative/minehunt/minehunt.qmlproject
@@ -3,13 +3,13 @@ import QmlProject 1.0
Project {
/* Include .qml, .js, and image files from current directory and subdirectories */
QmlFiles {
- directory: "."
+ directory: "qml/minehunt"
}
JavaScriptFiles {
- directory: "."
+ directory: "qml/minehunt"
}
ImageFiles {
- directory: "."
+ directory: "qml/minehunt"
}
/* List of plugin directories passed to QML runtime */
// importPaths: [ " ../exampleplugin " ]
diff --git a/demos/declarative/minehunt/MinehuntCore/Explosion.qml b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/Explosion.qml
index a5f3f1bc31..538d06bdad 100644
--- a/demos/declarative/minehunt/MinehuntCore/Explosion.qml
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/Explosion.qml
@@ -62,5 +62,4 @@ Item {
states: State { name: "exploding"; when: explode
StateChangeScript {script: particles.burst(200); }
}
-
}
diff --git a/demos/declarative/minehunt/MinehuntCore/Tile.qml b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/Tile.qml
index 90247f8575..90247f8575 100644
--- a/demos/declarative/minehunt/MinehuntCore/Tile.qml
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/Tile.qml
diff --git a/demos/declarative/minehunt/MinehuntCore/pics/back.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/back.png
index f6b3f0b4d7..f6b3f0b4d7 100644
--- a/demos/declarative/minehunt/MinehuntCore/pics/back.png
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/back.png
Binary files differ
diff --git a/demos/declarative/minehunt/MinehuntCore/pics/background.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/background.png
index 3734a27744..3734a27744 100644
--- a/demos/declarative/minehunt/MinehuntCore/pics/background.png
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/background.png
Binary files differ
diff --git a/demos/declarative/minehunt/MinehuntCore/pics/bomb-color.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb-color.png
index 61ad0a928f..61ad0a928f 100644
--- a/demos/declarative/minehunt/MinehuntCore/pics/bomb-color.png
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb-color.png
Binary files differ
diff --git a/demos/declarative/minehunt/MinehuntCore/pics/bomb.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb.png
index a992575518..a992575518 100644
--- a/demos/declarative/minehunt/MinehuntCore/pics/bomb.png
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb.png
Binary files differ
diff --git a/demos/declarative/minehunt/MinehuntCore/pics/face-sad.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-sad.png
index cf00aafe1f..cf00aafe1f 100644
--- a/demos/declarative/minehunt/MinehuntCore/pics/face-sad.png
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-sad.png
Binary files differ
diff --git a/demos/declarative/minehunt/MinehuntCore/pics/face-smile-big.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile-big.png
index f9c2335df5..f9c2335df5 100644
--- a/demos/declarative/minehunt/MinehuntCore/pics/face-smile-big.png
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile-big.png
Binary files differ
diff --git a/demos/declarative/minehunt/MinehuntCore/pics/face-smile.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile.png
index 3d66d72578..3d66d72578 100644
--- a/demos/declarative/minehunt/MinehuntCore/pics/face-smile.png
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile.png
Binary files differ
diff --git a/demos/declarative/minehunt/MinehuntCore/pics/flag-color.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag-color.png
index aadad0f11a..aadad0f11a 100644
--- a/demos/declarative/minehunt/MinehuntCore/pics/flag-color.png
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag-color.png
Binary files differ
diff --git a/demos/declarative/minehunt/MinehuntCore/pics/flag.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag.png
index 39cde4df82..39cde4df82 100644
--- a/demos/declarative/minehunt/MinehuntCore/pics/flag.png
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag.png
Binary files differ
diff --git a/demos/declarative/minehunt/MinehuntCore/pics/front.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/front.png
index 834331bd49..834331bd49 100644
--- a/demos/declarative/minehunt/MinehuntCore/pics/front.png
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/front.png
Binary files differ
diff --git a/demos/declarative/minehunt/MinehuntCore/pics/quit.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/quit.png
index b822057d4e..b822057d4e 100644
--- a/demos/declarative/minehunt/MinehuntCore/pics/quit.png
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/quit.png
Binary files differ
diff --git a/demos/declarative/minehunt/MinehuntCore/pics/star.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/star.png
index 3772359188..3772359188 100644
--- a/demos/declarative/minehunt/MinehuntCore/pics/star.png
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/star.png
Binary files differ
diff --git a/demos/declarative/minehunt/minehunt.qml b/demos/declarative/minehunt/qml/minehunt/minehunt.qml
index 2129350625..c64f21d1d3 100644
--- a/demos/declarative/minehunt/minehunt.qml
+++ b/demos/declarative/minehunt/qml/minehunt/minehunt.qml
@@ -40,7 +40,7 @@
****************************************************************************/
import QtQuick 1.0
-import "MinehuntCore" 1.0
+import "MinehuntCore"
Item {
id: field