summaryrefslogtreecommitdiffstats
path: root/examples/declarative/tic-tac-toe/content/TicTac.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/tic-tac-toe/content/TicTac.qml')
-rw-r--r--examples/declarative/tic-tac-toe/content/TicTac.qml20
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/declarative/tic-tac-toe/content/TicTac.qml b/examples/declarative/tic-tac-toe/content/TicTac.qml
new file mode 100644
index 0000000..eb80743
--- /dev/null
+++ b/examples/declarative/tic-tac-toe/content/TicTac.qml
@@ -0,0 +1,20 @@
+import Qt 4.6
+
+Item {
+ signal clicked
+
+ states: [
+ State { name: "X"; PropertyChanges { target: image; source: "pics/x.png" } },
+ State { name: "O"; PropertyChanges { target: image; source: "pics/o.png" } }
+ ]
+
+ Image {
+ id: image
+ anchors.centerIn: parent
+ }
+
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: parent.clicked()
+ }
+}