aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/minehunt
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2011-09-12 08:12:58 +0200
committerGunnar Sletta <gunnar.sletta@nokia.com>2011-09-12 08:12:58 +0200
commitd77218522eb480c8d528de18049cd7b604cdeb2a (patch)
treea6433a8e9205a95006eae10b53285a0e3487423d /examples/declarative/minehunt
parent589c8445e2623ef8e0b8294d7c558a2948b2a5e3 (diff)
parentd5686fa2ac2248d5a31237573fa08697f18f035f (diff)
Merge branch 'master' into refactor
Conflicts: examples/declarative/cppextensions/qwidgets/qwidgets.pro examples/declarative/minehunt/main.cpp examples/declarative/minehunt/minehunt.pro src/declarative/items/context2d/qsgcontext2d.cpp src/declarative/items/qsgflickable.cpp src/declarative/items/qsgtextedit.cpp src/declarative/items/qsgtextinput.cpp src/declarative/particles/qsgangleddirection.cpp src/declarative/particles/qsgcumulativedirection.cpp src/declarative/particles/qsgcumulativedirection_p.h src/declarative/particles/qsgfollowemitter.cpp src/declarative/particles/qsgmodelparticle.cpp src/declarative/particles/qsgparticlesystem.cpp src/qtquick1/util/qdeclarativeview.h tests/auto/declarative/examples/examples.pro tests/auto/declarative/qsgfocusscope/tst_qsgfocusscope.cpp Change-Id: Ib4be2a5e742dee1a399d73da97161736f77448e5
Diffstat (limited to 'examples/declarative/minehunt')
-rw-r--r--examples/declarative/minehunt/MinehuntCore/Explosion.qml33
-rw-r--r--examples/declarative/minehunt/MinehuntCore/Tile.qml2
-rw-r--r--examples/declarative/minehunt/MinehuntCore/qmldir4
-rw-r--r--examples/declarative/minehunt/main.cpp25
-rw-r--r--examples/declarative/minehunt/minehunt.pro17
-rw-r--r--examples/declarative/minehunt/minehunt.qml4
6 files changed, 33 insertions, 52 deletions
diff --git a/examples/declarative/minehunt/MinehuntCore/Explosion.qml b/examples/declarative/minehunt/MinehuntCore/Explosion.qml
index a5f3f1bc31..225c19d8a3 100644
--- a/examples/declarative/minehunt/MinehuntCore/Explosion.qml
+++ b/examples/declarative/minehunt/MinehuntCore/Explosion.qml
@@ -39,28 +39,31 @@
**
****************************************************************************/
-import QtQuick 1.0
-import Qt.labs.particles 1.0
+import QtQuick 2.0
+import QtQuick.Particles 2.0
Item {
property bool explode : false
-
- Particles {
- id: particles
+ ParticleSystem {
width: 40
height: 40
- lifeSpan: 1000
- lifeSpanDeviation: 0
- source: "pics/star.png"
- count: 0
- angle: 270
- angleDeviation: 360
- velocity: 100
- velocityDeviation: 20
- z: 100
+ ImageParticle {
+ particles: ["star"]
+ source: "file:MinehuntCore/pics/star.png" // TODO: Use qrc path once QTBUG-21129 is fixed
+ }
+ Emitter {
+ id: particles
+ emitting: false
+ anchors.centerIn: parent
+ particle: "star"
+ speed: AngledDirection { angleVariation: 360; magnitude: 150; magnitudeVariation: 50 }
+ emitRate: 200
+ z: 100
+ lifeSpan: 1000
+ }
}
states: State { name: "exploding"; when: explode
- StateChangeScript {script: particles.burst(200); }
+ StateChangeScript { script: particles.burst(200); }
}
}
diff --git a/examples/declarative/minehunt/MinehuntCore/Tile.qml b/examples/declarative/minehunt/MinehuntCore/Tile.qml
index 90247f8575..9daa669425 100644
--- a/examples/declarative/minehunt/MinehuntCore/Tile.qml
+++ b/examples/declarative/minehunt/MinehuntCore/Tile.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
Flipable {
id: flipable
diff --git a/examples/declarative/minehunt/MinehuntCore/qmldir b/examples/declarative/minehunt/MinehuntCore/qmldir
index 81980e09a6..a0213a19c4 100644
--- a/examples/declarative/minehunt/MinehuntCore/qmldir
+++ b/examples/declarative/minehunt/MinehuntCore/qmldir
@@ -1,2 +1,2 @@
-Explosion 1.0 Explosion.qml
-Tile 1.0 Tile.qml
+Explosion 2.0 Explosion.qml
+Tile 2.0 Tile.qml
diff --git a/examples/declarative/minehunt/main.cpp b/examples/declarative/minehunt/main.cpp
index 752e470d3f..2ae2cc0558 100644
--- a/examples/declarative/minehunt/main.cpp
+++ b/examples/declarative/minehunt/main.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include <QtWidgets/QApplication>
-#include <QtQuick1/QDeclarativeView>
+#include <QtGui/QGuiApplication>
+#include <qsgview.h>
#include <QtDeclarative/QDeclarativeContext>
#include <QtDeclarative/QDeclarativeEngine>
@@ -48,24 +48,17 @@
int main(int argc, char *argv[])
{
- QApplication app(argc, argv);
- QDeclarativeView canvas;
-
+ QGuiApplication app(argc, argv);
+ QSGView canvas;
+
qmlRegisterType<TileData>();
MinehuntGame* game = new MinehuntGame();
-
-#ifdef Q_OS_SYMBIAN
- canvas.setResizeMode(QDeclarativeView::SizeRootObjectToView);
-#endif
- canvas.engine()->rootContext()->setContextObject(game);
+
+ canvas.setResizeMode(QSGView::SizeRootObjectToView);
+ 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
return app.exec();
}
diff --git a/examples/declarative/minehunt/minehunt.pro b/examples/declarative/minehunt/minehunt.pro
index 12c167236c..cf928ce333 100644
--- a/examples/declarative/minehunt/minehunt.pro
+++ b/examples/declarative/minehunt/minehunt.pro
@@ -1,23 +1,8 @@
TEMPLATE = app
TARGET = minehunt
-QT += declarative qtquick1 widgets
+QT += declarative
# Input
HEADERS += minehunt.h
SOURCES += main.cpp minehunt.cpp
RESOURCES = minehunt.qrc
-
-sources.files = minehunt.qml minehunt.pro MinehuntCore
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/declarative/minehunt
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/declarative/minehunt
-
-INSTALLS = sources target
-
-symbian:{
- TARGET.EPOCALLOWDLLDATA = 1
- TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
- CONFIG += qt_example
- qmlminehuntfiles.files = MinehuntCore minehunt.qml
- DEPLOYMENT += qmlminehuntfiles
-}
-
diff --git a/examples/declarative/minehunt/minehunt.qml b/examples/declarative/minehunt/minehunt.qml
index 2129350625..80aaeab185 100644
--- a/examples/declarative/minehunt/minehunt.qml
+++ b/examples/declarative/minehunt/minehunt.qml
@@ -39,8 +39,8 @@
**
****************************************************************************/
-import QtQuick 1.0
-import "MinehuntCore" 1.0
+import QtQuick 2.0
+import "MinehuntCore" 2.0
Item {
id: field