summaryrefslogtreecommitdiffstats
path: root/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml
blob: 6848534ade995ba66cd40769a41f81d19680692b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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;
    }

    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(); }
}