summaryrefslogtreecommitdiffstats
path: root/examples/declarative/toys/tic-tac-toe/content/TicTac.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/toys/tic-tac-toe/content/TicTac.qml')
-rw-r--r--examples/declarative/toys/tic-tac-toe/content/TicTac.qml20
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/declarative/toys/tic-tac-toe/content/TicTac.qml b/examples/declarative/toys/tic-tac-toe/content/TicTac.qml
new file mode 100644
index 0000000..d247943
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/content/TicTac.qml
@@ -0,0 +1,20 @@
+import Qt 4.7
+
+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
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.clicked()
+ }
+}