summaryrefslogtreecommitdiffstats
path: root/examples/declarative/toys/clocks
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/toys/clocks')
-rw-r--r--examples/declarative/toys/clocks/clocks.qml5
-rw-r--r--examples/declarative/toys/clocks/content/QuitButton.qml12
-rw-r--r--examples/declarative/toys/clocks/content/quit.pngbin0 -> 583 bytes
3 files changed, 17 insertions, 0 deletions
diff --git a/examples/declarative/toys/clocks/clocks.qml b/examples/declarative/toys/clocks/clocks.qml
index 124e391..82a1dbf 100644
--- a/examples/declarative/toys/clocks/clocks.qml
+++ b/examples/declarative/toys/clocks/clocks.qml
@@ -51,4 +51,9 @@ Rectangle {
Clock { city: "Mumbai"; shift: 5.5 }
Clock { city: "Tokyo"; shift: 9 }
}
+ QuitButton {
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.margins: 10
+ }
}
diff --git a/examples/declarative/toys/clocks/content/QuitButton.qml b/examples/declarative/toys/clocks/content/QuitButton.qml
new file mode 100644
index 0000000..70747a8
--- /dev/null
+++ b/examples/declarative/toys/clocks/content/QuitButton.qml
@@ -0,0 +1,12 @@
+import Qt 4.7
+Image {
+ source: "quit.png"
+ scale: quitMouse.pressed ? 0.8 : 1.0
+ smooth: quitMouse.pressed
+ MouseArea {
+ id: quitMouse
+ anchors.fill: parent
+ anchors.margins: -10
+ onClicked: Qt.quit()
+ }
+} \ No newline at end of file
diff --git a/examples/declarative/toys/clocks/content/quit.png b/examples/declarative/toys/clocks/content/quit.png
new file mode 100644
index 0000000..b822057
--- /dev/null
+++ b/examples/declarative/toys/clocks/content/quit.png
Binary files differ