diff options
Diffstat (limited to 'examples/declarative/tutorials/samegame/samegame3/Block.qml')
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame3/Block.qml | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/examples/declarative/tutorials/samegame/samegame3/Block.qml b/examples/declarative/tutorials/samegame/samegame3/Block.qml index bb48ac8..dd0fb48 100644 --- a/examples/declarative/tutorials/samegame/samegame3/Block.qml +++ b/examples/declarative/tutorials/samegame/samegame3/Block.qml @@ -2,20 +2,22 @@ import Qt 4.7 Item { - id:block + id: block + property int type: 0 - Image { id: img + Image { + id: img + + anchors.fill: parent source: { - if(type == 0){ - "../shared/pics/redStone.png"; - } else if(type == 1) { - "../shared/pics/blueStone.png"; - } else { - "../shared/pics/greenStone.png"; - } + if (type == 0) + return "../shared/pics/redStone.png"; + else if (type == 1) + return "../shared/pics/blueStone.png"; + else + return "../shared/pics/greenStone.png"; } - anchors.fill: parent } } //![0] |