summaryrefslogtreecommitdiffstats
path: root/demos/declarative/samegame/content/Dialog.qml
blob: 401d211f84cdbde78669543de8d6956b5f0f27e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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(); }
}