Examples separated out of Ie808e78a42074e13aa9d3c87723ec9ac8fdbaf4a
[profile/ivi/qtdeclarative.git] / examples / window / window / standalone.qml
index 5d96c37..079694c 100644 (file)
 ****************************************************************************/
 
 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