summaryrefslogtreecommitdiff
path: root/examples/declarative/tutorials/samegame/samegame3/Dialog.qml
blob: 69bae7cc6ad1e75e3e99d211ba750b963c6007b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//![0]
import Qt 4.7

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
    Behavior on opacity { 
        NumberAnimation { duration: 1000 }
    }
    Text { id: myText; anchors.centerIn: parent; text: "Hello World!" }
    MouseArea { id: mouseArea; anchors.fill: parent; onClicked: forceClose(); }
}
//![0]