summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative/qtbinding/stopwatch/main.qml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets/declarative/qtbinding/stopwatch/main.qml')
-rw-r--r--doc/src/snippets/declarative/qtbinding/stopwatch/main.qml18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/src/snippets/declarative/qtbinding/stopwatch/main.qml b/doc/src/snippets/declarative/qtbinding/stopwatch/main.qml
new file mode 100644
index 0000000000..2efa542d78
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/stopwatch/main.qml
@@ -0,0 +1,18 @@
+//![0]
+import Qt 4.7
+
+Rectangle {
+ width: 300
+ height: 300
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (stopwatch.isRunning())
+ stopwatch.stop()
+ else
+ stopwatch.start();
+ }
+ }
+}
+//![0]