diff options
Diffstat (limited to 'examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml')
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml b/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml index 15f5b19..adb3f9e 100644 --- a/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml +++ b/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml @@ -2,20 +2,29 @@ import Qt 4.7 Rectangle { id: page + + signal closed + function forceClose() { page.closed(); page.opacity = 0; } + function show(txt) { dialogText.text = txt; page.opacity = 1; } - signal closed(); - color: "white"; border.width: 1; width: dialogText.width + 20; height: dialogText.height + 20; + + width: dialogText.width + 20; height: dialogText.height + 20 + color: "white" + border.width: 1 opacity: 0 + Behavior on opacity { NumberAnimation { duration: 1000 } } + Text { id: dialogText; anchors.centerIn: parent; text: "Hello World!" } + MouseArea { anchors.fill: parent; onClicked: forceClose(); } } |