summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-03-01 13:02:13 +0100
committerJesper Thomschutz <jesper.thomschutz@nokia.com>2010-03-01 19:10:46 +0100
commit0ea361c00a77be43a702d2d02845b42f320a0432 (patch)
treefb650e3320683b80f2a07d2455ab02e577319d08
parent4eb72672fcbb0fb334528c75ffd576c3f7acf8aa (diff)
Fix minehunt demo
Game works again, and the issue with X11 native rendering being abysmally slow has been 'fixed'. (cherry picked from commit bcb2ed5667bd957476e3b62ef3a479a26f1252f3)
-rw-r--r--demos/declarative/minehunt/main.cpp4
-rw-r--r--demos/declarative/minehunt/minehunt.qml14
2 files changed, 11 insertions, 7 deletions
diff --git a/demos/declarative/minehunt/main.cpp b/demos/declarative/minehunt/main.cpp
index 37dc8a5e34..e7a1d7c2f4 100644
--- a/demos/declarative/minehunt/main.cpp
+++ b/demos/declarative/minehunt/main.cpp
@@ -317,6 +317,10 @@ bool MyWidget::flag(int row, int col)
int main(int argc, char ** argv)
{
+#ifdef Q_WS_X11
+ // native on X11 is terrible for this demo.
+ QApplication::setGraphicsSystem("raster");
+#endif
QApplication app(argc, argv);
bool frameless = false;
diff --git a/demos/declarative/minehunt/minehunt.qml b/demos/declarative/minehunt/minehunt.qml
index 617a6ed1eb..8a3cab17be 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: model.hasFlag
+ opacity: modelData.hasFlag
opacity: Behavior {
NumberAnimation {
property: "opacity"
@@ -47,16 +47,16 @@ Item {
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
+ opacity: modelData.hasMine
}
Explosion {
id: expl
@@ -65,7 +65,7 @@ Item {
states: [
State {
name: "back"
- when: model.flipped
+ when: modelData.flipped
PropertyChanges { target: flipable; angle: 180 }
}
]
@@ -81,7 +81,7 @@ Item {
else
ret = 0;
if (ret > 0) {
- if (model.hasMine && model.flipped) {
+ if (modelData.hasMine && modelData.flipped) {
ret*3;
} else {
ret;
@@ -96,7 +96,7 @@ Item {
properties: "angle"
}
ScriptAction{
- script: if(model.hasMine && model.flipped){expl.explode = true;}
+ script: if(modelData.hasMine && modelData.flipped){expl.explode = true;}
}
}
}