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

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

    XMLWordPrintable

    Details

    • Platform/s:
      macOS

      Description

      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.

        Attachments

        1. quit-prompting.dot
          4 kB
        2. quit-prompting.pdf
          20 kB
        3. quit-prompting.png
          quit-prompting.png
          320 kB

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews