summaryrefslogtreecommitdiffstats
path: root/demos/declarative/minehunt/minehunt.qml
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2010-04-09 03:53:30 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2010-04-09 03:55:02 (GMT)
commitfb9f0c5c996f2ba27c43657c49f100daf4729e05 (patch)
treeb83e72483adb1ca9d677811c3630b1329393fa12 /demos/declarative/minehunt/minehunt.qml
parentda56d7c25ce344128d827cfa2ed26f9eea437e4d (diff)
downloadQt-fb9f0c5c996f2ba27c43657c49f100daf4729e05.zip
Qt-fb9f0c5c996f2ba27c43657c49f100daf4729e05.tar.gz
Qt-fb9f0c5c996f2ba27c43657c49f100daf4729e05.tar.bz2
Text.wrap is deprecated
Diffstat (limited to 'demos/declarative/minehunt/minehunt.qml')
-rw-r--r--demos/declarative/minehunt/minehunt.qml33
1 files changed, 17 insertions, 16 deletions
diff --git a/demos/declarative/minehunt/minehunt.qml b/demos/declarative/minehunt/minehunt.qml
index 4e384c0..98955e2 100644
--- a/demos/declarative/minehunt/minehunt.qml
+++ b/demos/declarative/minehunt/minehunt.qml
@@ -86,19 +86,20 @@ Item {
field.clicky = flipable.parent.y
var row = Math.floor(index / 9)
var col = index - (Math.floor(index / 9) * 9)
- if (mouse.button == undefined || mouse.button == Qt.RightButton)
+ if (mouse.button == undefined || mouse.button == Qt.RightButton) {
flag(row, col)
- else
- flip(row, col)
- }
- onPressAndHold: {
- field.clickx = flipable.parent.x
- field.clicky = flipable.parent.y
- var row = Math.floor(index / 9)
- var col = index - (Math.floor(index / 9) * 9)
- flag(row, col)
- }
+ } else {
+ flip(row, col)
}
+ }
+ onPressAndHold: {
+ field.clickx = flipable.parent.x
+ field.clicky = flipable.parent.y
+ var row = Math.floor(index / 9)
+ var col = index - (Math.floor(index / 9) * 9)
+ flag(row, col)
+ }
+ }
}
}
@@ -136,13 +137,13 @@ Item {
Image {
anchors.bottom: field.bottom; anchors.bottomMargin: 15
anchors.right: field.right; anchors.rightMargin: 20
- source: isPlaying ? 'MinehuntCore/pics/face-smile.png'
- : hasWon ? 'MinehuntCore/pics/face-smile-big.png': 'MinehuntCore/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() }
- }
+ MouseArea { anchors.fill: parent; onPressed: reset() }
+ }
Text {
- anchors.fill: parent; wrap: true
+ anchors.fill: parent; wrapMode: Text.WordWrap
text: "Minehunt will not run properly if the C++ plugin is not compiled.\nPlease see README."
color: "white"; font.bold: true; font.pixelSize: 14
visible: tiles == undefined