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