summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-02-18 16:05:50 +1000
committerMartin Jones <martin.jones@nokia.com>2010-02-18 16:05:50 +1000
commitc8e266aaf21f470fd45ac61244466583b503fda2 (patch)
tree694c73b774cf77c590cecdfb1b6d14fcd5052a8b /demos
parent635b329592f26d64eeb6212b6056249b15293dcf (diff)
downloadqt4-tools-c8e266aaf21f470fd45ac61244466583b503fda2.tar.gz
QmlView API review. See QmlChanges.txt for details.
Diffstat (limited to 'demos')
-rw-r--r--demos/declarative/minehunt/main.cpp5
-rw-r--r--demos/declarative/minehunt/minehunt.qml14
2 files changed, 8 insertions, 11 deletions
diff --git a/demos/declarative/minehunt/main.cpp b/demos/declarative/minehunt/main.cpp
index c756e66d0c..ac01196206 100644
--- a/demos/declarative/minehunt/main.cpp
+++ b/demos/declarative/minehunt/main.cpp
@@ -167,10 +167,7 @@ MyWidget::MyWidget(int width, int height, QWidget *parent, Qt::WindowFlags flags
canvas->setFixedSize(width, height);
vbox->addWidget(canvas);
- QFile file(fileName);
- file.open(QFile::ReadOnly);
- QString qml = file.readAll();
- canvas->setQml(qml, fileName);
+ canvas->setSource(QUrl::fromLocalFile(fileName));
QmlContext *ctxt = canvas->rootContext();
ctxt->addDefaultObject(this);
diff --git a/demos/declarative/minehunt/minehunt.qml b/demos/declarative/minehunt/minehunt.qml
index ff00d83072..033a865de6 100644
--- a/demos/declarative/minehunt/minehunt.qml
+++ b/demos/declarative/minehunt/minehunt.qml
@@ -31,7 +31,7 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
source: "pics/flag.png"
- opacity: modelData.hasFlag
+ opacity: model.hasFlag
opacity: Behavior {
NumberAnimation {
property: "opacity"
@@ -47,16 +47,16 @@ Item {
Text {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
- text: modelData.hint
+ text: model.hint
color: "white"
font.bold: true
- opacity: !modelData.hasMine && modelData.hint > 0
+ opacity: !model.hasMine && model.hint > 0
}
Image {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
source: "pics/bomb.png"
- opacity: modelData.hasMine
+ opacity: model.hasMine
}
Explosion {
id: expl
@@ -65,7 +65,7 @@ Item {
states: [
State {
name: "back"
- when: modelData.flipped
+ when: model.flipped
PropertyChanges { target: flipable; angle: 180 }
}
]
@@ -81,7 +81,7 @@ Item {
else
ret = 0;
if (ret > 0) {
- if (modelData.hasMine && modelData.flipped) {
+ if (model.hasMine && model.flipped) {
ret*3;
} else {
ret;
@@ -96,7 +96,7 @@ Item {
matchProperties: "angle"
}
ScriptAction{
- script: if(modelData.hasMine && modelData.flipped){expl.explode = true;}
+ script: if(model.hasMine && model.flipped){expl.explode = true;}
}
}
}