summaryrefslogtreecommitdiffstats
path: root/demos/declarative/samegame/SamegameCore/Dialog.qml
diff options
context:
space:
mode:
Diffstat (limited to 'demos/declarative/samegame/SamegameCore/Dialog.qml')
-rw-r--r--demos/declarative/samegame/SamegameCore/Dialog.qml22
1 files changed, 22 insertions, 0 deletions
diff --git a/demos/declarative/samegame/SamegameCore/Dialog.qml b/demos/declarative/samegame/SamegameCore/Dialog.qml
new file mode 100644
index 0000000..6d5d6b5
--- /dev/null
+++ b/demos/declarative/samegame/SamegameCore/Dialog.qml
@@ -0,0 +1,22 @@
+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();
+ property Item text: myText
+ color: "white"; border.width: 1; width: myText.width + 20; height: myText.height + 40;
+ opacity: 0
+ Behavior on opacity {
+ NumberAnimation { duration: 1000 }
+ }
+ Text { id: myText; anchors.centerIn: parent; text: "Hello World!" }
+ MouseArea { id: mr; anchors.fill: parent; onClicked: forceClose(); }
+}