summaryrefslogtreecommitdiffstats
path: root/examples/declarative/tutorials/samegame/samegame3/Dialog.qml
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-10-07 01:03:21 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-10-07 01:03:21 (GMT)
commit95821d745a60e60422294dd718cbed5678ef5f1f (patch)
treef842b1f053c6c8f9664415e6dd2670e4cd9be919 /examples/declarative/tutorials/samegame/samegame3/Dialog.qml
parente25009d28c58b3ff7541374475f8c2c278cef02e (diff)
downloadQt-95821d745a60e60422294dd718cbed5678ef5f1f.zip
Qt-95821d745a60e60422294dd718cbed5678ef5f1f.tar.gz
Qt-95821d745a60e60422294dd718cbed5678ef5f1f.tar.bz2
Add SameGame based advanced tutorial
Could use some cleanup, as I didn't manage to get code snippets working correctly. Also might benefit from being re-written by a good tutor.
Diffstat (limited to 'examples/declarative/tutorials/samegame/samegame3/Dialog.qml')
-rw-r--r--examples/declarative/tutorials/samegame/samegame3/Dialog.qml21
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/declarative/tutorials/samegame/samegame3/Dialog.qml b/examples/declarative/tutorials/samegame/samegame3/Dialog.qml
new file mode 100644
index 0000000..401d211
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame3/Dialog.qml
@@ -0,0 +1,21 @@
+import Qt 4.6
+
+Rectangle {
+ id: page
+ function forceClose() {
+ page.closed();
+ page.opacity = 0;
+ }
+ function show(txt) {
+ MyText.text = txt;
+ page.opacity = 1;
+ }
+ signal closed();
+ color: "white"; border.width: 1; width: MyText.width + 20; height: 60;
+ opacity: 0
+ opacity: Behavior {
+ NumberAnimation { duration: 1000 }
+ }
+ Text { id: MyText; anchors.centerIn: parent; text: "Hello World!" }
+ MouseRegion { id: mr; anchors.fill: parent; onClicked: forceClose(); }
+}