summaryrefslogtreecommitdiffstats
path: root/demos/declarative/samegame/content/Dialog.qml
diff options
context:
space:
mode:
Diffstat (limited to 'demos/declarative/samegame/content/Dialog.qml')
-rw-r--r--demos/declarative/samegame/content/Dialog.qml18
1 files changed, 12 insertions, 6 deletions
diff --git a/demos/declarative/samegame/content/Dialog.qml b/demos/declarative/samegame/content/Dialog.qml
index 72c7900..401d211 100644
--- a/demos/declarative/samegame/content/Dialog.qml
+++ b/demos/declarative/samegame/content/Dialog.qml
@@ -2,14 +2,20 @@ 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;
- property string text: "Hello World!"
opacity: 0
opacity: Behavior {
- SequentialAnimation {
- NumberAnimation {property: "opacity"; from: 0; duration: 1500 }
- NumberAnimation {property: "opacity"; to: 0; duration: 1500 }
- }
+ NumberAnimation { duration: 1000 }
}
- Text { id: MyText; anchors.centerIn: parent; text: parent.text }
+ Text { id: MyText; anchors.centerIn: parent; text: "Hello World!" }
+ MouseRegion { id: mr; anchors.fill: parent; onClicked: forceClose(); }
}