summaryrefslogtreecommitdiffstats
path: root/demos/declarative/minehunt
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-11-11 02:56:47 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-11-11 08:08:29 (GMT)
commitedd306f681d3c53d00c0a99c68775615cc0a2d5e (patch)
treeeca739e1ebb707024306bc93e20862daa5df362c /demos/declarative/minehunt
parent8e5166aba8c8d79e47d4c4fccd5acf52f9cffec6 (diff)
downloadQt-edd306f681d3c53d00c0a99c68775615cc0a2d5e.zip
Qt-edd306f681d3c53d00c0a99c68775615cc0a2d5e.tar.gz
Qt-edd306f681d3c53d00c0a99c68775615cc0a2d5e.tar.bz2
Fix minehunt demo
Diffstat (limited to 'demos/declarative/minehunt')
-rw-r--r--demos/declarative/minehunt/main.cpp1
-rwxr-xr-xdemos/declarative/minehunt/minehuntbin0 -> 302213 bytes
-rw-r--r--demos/declarative/minehunt/minehunt.qml5
-rw-r--r--demos/declarative/minehunt/test.qml13
4 files changed, 17 insertions, 2 deletions
diff --git a/demos/declarative/minehunt/main.cpp b/demos/declarative/minehunt/main.cpp
index 5e67cc1..895648f 100644
--- a/demos/declarative/minehunt/main.cpp
+++ b/demos/declarative/minehunt/main.cpp
@@ -174,6 +174,7 @@ MyWidget::MyWidget(int width, int height, QWidget *parent, Qt::WindowFlags flags
QmlContext *ctxt = canvas->rootContext();
ctxt->addDefaultObject(this);
+ ctxt->setContextProperty("tiles", QVariant::fromValue<QList<Tile*>*>(&_tiles));//QTBUG-5675
canvas->execute();
}
diff --git a/demos/declarative/minehunt/minehunt b/demos/declarative/minehunt/minehunt
new file mode 100755
index 0000000..94584a9
--- /dev/null
+++ b/demos/declarative/minehunt/minehunt
Binary files differ
diff --git a/demos/declarative/minehunt/minehunt.qml b/demos/declarative/minehunt/minehunt.qml
index 596e82d..ff00d83 100644
--- a/demos/declarative/minehunt/minehunt.qml
+++ b/demos/declarative/minehunt/minehunt.qml
@@ -107,8 +107,8 @@ Item {
onPressed: {
field.clickx = flipable.parent.x;
field.clicky = flipable.parent.y;
- row = Math.floor(index/9);
- col = index - (Math.floor(index/9) * 9);
+ var row = Math.floor(index/9);
+ var col = index - (Math.floor(index/9) * 9);
if (mouse.button==undefined || mouse.button==Qt.RightButton) {
flag(row,col);
} else {
@@ -131,6 +131,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter
}
Repeater {
+ id: repeater
model: tiles
x: 1
y: 1
diff --git a/demos/declarative/minehunt/test.qml b/demos/declarative/minehunt/test.qml
new file mode 100644
index 0000000..11ed182
--- /dev/null
+++ b/demos/declarative/minehunt/test.qml
@@ -0,0 +1,13 @@
+import Qt 4.6
+
+ Image {
+ source: "pics/front.png"
+ width: 40
+ height: 40
+ Image {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ source: "pics/flag.png"
+ opacity: 1
+ }
+ }