diff options
Diffstat (limited to 'examples/declarative/tutorials/samegame/samegame3/Dialog.qml')
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame3/Dialog.qml | 23 |
1 files changed, 23 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..96dc246 --- /dev/null +++ b/examples/declarative/tutorials/samegame/samegame3/Dialog.qml @@ -0,0 +1,23 @@ +//![0] +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(); } +} +//![0] |