Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
-
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.