diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-09-02 05:16:25 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-09-02 05:16:25 (GMT) |
commit | 373e090de85ee8c46cbd400d4b5fbf37d4b59eae (patch) | |
tree | 5eed8645e3c0b6e08230885cb3da184e44dad067 /demos/declarative/samegame/content/Dialog.qml | |
parent | d76c52133160f4394df2d6dc4d239c54833c1ab3 (diff) | |
parent | b6e26ee808ae3ffe1c4fba03cc89baf47d65d3a8 (diff) | |
download | Qt-373e090de85ee8c46cbd400d4b5fbf37d4b59eae.zip Qt-373e090de85ee8c46cbd400d4b5fbf37d4b59eae.tar.gz Qt-373e090de85ee8c46cbd400d4b5fbf37d4b59eae.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'demos/declarative/samegame/content/Dialog.qml')
-rw-r--r-- | demos/declarative/samegame/content/Dialog.qml | 18 |
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(); } } |