Here is the actual QML code contained in the example click package:

import QtQuick 2.4
import QtQuick.Window 2.2
QtObject {
  readonly property var allWindows: []
  property var windowFactory: Component {
    Window {
      onClosing: destroy()
      Component.onCompleted: allWindows.push(this)
      Component.onDestruction: {
        for (var w in allWindows) {
          if (this === allWindows[w]) {
            allWindows.splice(w, 1)
            return
          }
        }
      }
      Rectangle {
        anchors {
          fill: parent
          margins: 20
        }
        color: Qt.rgba(Math.random(), Math.random(), Math.random(), 1)
      }
      MouseArea {
        anchors.fill: parent
        onClicked: windowFactory.createObject(null).show()
      }
    }
  }
  property var applicationMonitor: Connections {
    target: Qt.application
    onAboutToQuit: console.log("quitting application, %1 windows 
open".arg(allWindows.length))
  }
  Component.onCompleted: windowFactory.createObject(null).show()
}

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1622717

Title:
  "Quit" from quicklist doesn’t close all open windows, doesn’t actually
  quit the application

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1622717/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to