Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-33235

OSX: QQuickWindow doesn't get a closeEvent on Cmd+Q

XMLWordPrintable

    • macOS

      import QtQuick 2.1
      import QtQuick.Window 2.1
      import QtQuick.Controls 1.0
      
      Window {
          title: qsTr("Hello World")
          width: 640
          height: 480
      
          property bool __canClose: false
          
          onClosing: {
              close.accepted = __canClose;
          }
          
          Button {
              text: qsTr("Allow close")
              anchors.horizontalCenter: parent.horizontalCenter
              anchors.verticalCenter: parent.verticalCenter
              onClicked: __canClose = true;
          }
      }
      

      The Window doesn't send a closing event for Cmd+Q but it does if you click the red x close button.

        1. quit-prompting.dot
          4 kB
        2. quit-prompting.pdf
          20 kB
        3. quit-prompting.png
          quit-prompting.png
          320 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            vestbo Tor Arne Vestbø
            daiweili Daiwei Li
            Votes:
            10 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved: