summaryrefslogtreecommitdiffstats
path: root/demos/declarative/minehunt/minehunt.qml
diff options
context:
space:
mode:
Diffstat (limited to 'demos/declarative/minehunt/minehunt.qml')
-rw-r--r--demos/declarative/minehunt/minehunt.qml40
1 files changed, 17 insertions, 23 deletions
diff --git a/demos/declarative/minehunt/minehunt.qml b/demos/declarative/minehunt/minehunt.qml
index 617a6ed..9e99706 100644
--- a/demos/declarative/minehunt/minehunt.qml
+++ b/demos/declarative/minehunt/minehunt.qml
@@ -1,4 +1,5 @@
import Qt 4.6
+import MinehuntCore 1.0
Item {
id: field
@@ -24,15 +25,15 @@ Item {
angle: flipable.angle;
}
front: Image {
- source: "pics/front.png"
+ source: "MinehuntCore/pics/front.png"
width: 40
height: 40
Image {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
- source: "pics/flag.png"
- opacity: model.hasFlag
- opacity: Behavior {
+ source: "MinehuntCore/pics/flag.png"
+ opacity: modelData.hasFlag
+ Behavior on opacity {
NumberAnimation {
property: "opacity"
duration: 250
@@ -41,22 +42,22 @@ Item {
}
}
back: Image {
- source: "pics/back.png"
+ source: "MinehuntCore/pics/back.png"
width: 40
height: 40
Text {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
- text: model.hint
+ text: modelData.hint
color: "white"
font.bold: true
- opacity: !model.hasMine && model.hint > 0
+ opacity: !modelData.hasMine && modelData.hint > 0
}
Image {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
- source: "pics/bomb.png"
- opacity: model.hasMine
+ source: "MinehuntCore/pics/bomb.png"
+ opacity: modelData.hasMine
}
Explosion {
id: expl
@@ -65,7 +66,7 @@ Item {
states: [
State {
name: "back"
- when: model.flipped
+ when: modelData.flipped
PropertyChanges { target: flipable; angle: 180 }
}
]
@@ -81,7 +82,7 @@ Item {
else
ret = 0;
if (ret > 0) {
- if (model.hasMine && model.flipped) {
+ if (modelData.hasMine && modelData.flipped) {
ret*3;
} else {
ret;
@@ -96,7 +97,7 @@ Item {
properties: "angle"
}
ScriptAction{
- script: if(model.hasMine && model.flipped){expl.explode = true;}
+ script: if(modelData.hasMine && modelData.flipped){expl.explode = true;}
}
}
}
@@ -120,16 +121,9 @@ Item {
}
]
Image {
- source: "pics/No-Ones-Laughing-3.jpg"
+ source: "MinehuntCore/pics/No-Ones-Laughing-3.jpg"
fillMode: Image.Tile
}
- Description {
- text: "Use the 'minehunt' executable to run this demo!"
- width: 300
- opacity: tiles?0:1
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- }
Repeater {
id: repeater
model: tiles
@@ -156,7 +150,7 @@ Item {
Image {
// x: 100
// y: 20
- source: "pics/bomb-color.png"
+ source: "MinehuntCore/pics/bomb-color.png"
}
Text {
// x: 100
@@ -172,7 +166,7 @@ Item {
Image {
// x: 140
// y: 20
- source: "pics/flag-color.png"
+ source: "MinehuntCore/pics/flag-color.png"
}
Text {
// x: 140
@@ -187,7 +181,7 @@ Item {
y: 390
anchors.right: field.right
anchors.rightMargin: 20
- source: isPlaying ? 'pics/face-smile.png' : hasWon ? 'pics/face-smile-big.png': 'pics/face-sad.png'
+ source: isPlaying ? 'MinehuntCore/pics/face-smile.png' : hasWon ? 'MinehuntCore/pics/face-smile-big.png': 'MinehuntCore/pics/face-sad.png'
MouseArea {
anchors.fill: parent
onPressed: { reset() }