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

[macOS] can't prevent an application to quit on Command+Q

    XMLWordPrintable

    Details

    • Platform/s:
      macOS

      Description

      See attached self contained example.

      Subclassing QQuickView::event and returning false on an event of type QEvent::Close doesn't prevent the application to quit.

      This mechanism works on Linux and Windows but not on macOS (I'm using 10.13.4)

      So basically I have no way to implement a "Save before exit" step.

      [EDIT] after comments (and adding event->ignore()), the issue is now only related to Cmd+Q or "Quit" from menu. I haven't found a way on macOS to prevent the application to quit

        Attachments

          Issue Links

          For Gerrit Dashboard: QTBUG-72013
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              vestbo Tor Arne Vestbø
              Reporter:
              mcallegari79 Massimo Callegari
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes