From 99b7d495530335bef8590e6b8a1266e3ec570955 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 5 Nov 2012 11:16:14 +0100 Subject: Examples separated out of Ie808e78a42074e13aa9d3c87723ec9ac8fdbaf4a MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iec54ed5d7c41c6103ddfe07509b905914806d435 Reviewed-by: Samuel Rødal --- examples/window/window/standalone.qml | 40 ++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 12 deletions(-) (limited to 'examples/window/window/standalone.qml') diff --git a/examples/window/window/standalone.qml b/examples/window/window/standalone.qml index 5d96c37142..079694cc10 100644 --- a/examples/window/window/standalone.qml +++ b/examples/window/window/standalone.qml @@ -39,25 +39,41 @@ ****************************************************************************/ import QtQuick 2.0 -import QtQuick.Window 2.0 as Window +import QtQuick.Window 2.0 Item { - width: 640 - height: 480 + width: 320 + height: 240 Text { anchors.centerIn: parent text: "First Window" } - MouseArea { - anchors.fill: parent - onClicked: Qt.quit() + Rectangle { + border.color: "black" + color: childWindow.visible ? "green" : "yellow" + radius: height / 4 + anchors.bottom: parent.bottom + anchors.right: parent.right + anchors.margins: 10 + width: text.implicitWidth + 20 + height: text.implicitHeight + 20 + Text { + id: text + text: "Pop up window" + anchors.centerIn: parent + } + MouseArea { + anchors.fill: parent + onClicked: childWindow.visible = !childWindow.visible + } } - Window.Window { - width: 640 - height: 480 - x: 640 - y: 480 - visible: true + + Window { + id: childWindow + width: 320 + height: 240 + x: 320 + y: 240 color: "green" Text { anchors.centerIn: parent -- cgit v1.2.3