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

Document the fact that the quit shortcut may skip the emission of the QQuickWindow::closing() signal when using a "global" menu bar

    XMLWordPrintable

Details

    • 3065866a098ce79594e3a70ae66b24a4d6fa7287

    Description

      As this answer explains, if there is no menu item whose text is "quit" or "exit", one will be created, and it will call QCoreApplication::quit(). This skips the emission of the QQuickWindow::closing() signal, which means code like this will be skipped:

          onClosing: {
              close.accepted = false
              doIfChangesDiscarded(function() { Qt.quit() })
          }
      

      The documentation for http://doc.qt.io/qt-5/qquickwindow.html#closing should mention this (and link to http://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar), as it is very confusing to have the behaviour be different across platforms and not know why.

      Attachments

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

        Activity

          People

            vertries Nico Vertriest (Inactive)
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes