diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-11-11 02:56:47 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-11-11 08:08:29 (GMT) |
commit | edd306f681d3c53d00c0a99c68775615cc0a2d5e (patch) | |
tree | eca739e1ebb707024306bc93e20862daa5df362c /demos | |
parent | 8e5166aba8c8d79e47d4c4fccd5acf52f9cffec6 (diff) | |
download | Qt-edd306f681d3c53d00c0a99c68775615cc0a2d5e.zip Qt-edd306f681d3c53d00c0a99c68775615cc0a2d5e.tar.gz Qt-edd306f681d3c53d00c0a99c68775615cc0a2d5e.tar.bz2 |
Fix minehunt demo
Diffstat (limited to 'demos')
-rw-r--r-- | demos/declarative/minehunt/main.cpp | 1 | ||||
-rwxr-xr-x | demos/declarative/minehunt/minehunt | bin | 0 -> 302213 bytes | |||
-rw-r--r-- | demos/declarative/minehunt/minehunt.qml | 5 | ||||
-rw-r--r-- | demos/declarative/minehunt/test.qml | 13 |
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 Binary files differnew file mode 100755 index 0000000..94584a9 --- /dev/null +++ b/demos/declarative/minehunt/minehunt 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 + } + } |