summaryrefslogtreecommitdiffstats
path: root/examples/declarative/tutorials/samegame/samegame3/Block.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/tutorials/samegame/samegame3/Block.qml')
-rw-r--r--examples/declarative/tutorials/samegame/samegame3/Block.qml21
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/declarative/tutorials/samegame/samegame3/Block.qml b/examples/declarative/tutorials/samegame/samegame3/Block.qml
new file mode 100644
index 0000000..30a8d3a
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame3/Block.qml
@@ -0,0 +1,21 @@
+//![0]
+import Qt 4.6
+
+Item {
+ id:block
+ property int type: 0
+
+ Image { id: img
+ source: {
+ if(type == 0){
+ "pics/redStone.png";
+ } else if(type == 1) {
+ "pics/blueStone.png";
+ } else {
+ "pics/greenStone.png";
+ }
+ }
+ anchors.fill: parent
+ }
+}
+//![0]