QWidget::closeEvent is called twice (it doesn't matter if the event is accepted or not).
See attached minimal application.
This regression was marked as fixed in
QTBUG-39398, but for me it is not.
I have Qt 5.4 statically build on osx, the patch is there, but i still can reproduce the issue using the test app in
i have fixed it for myself locally by not calling canQuit and calling QGuiApplication::exit(0) only if all windows did accept their close (and closed).
|For Gerrit Dashboard: QTBUG-43344|
|125587,2||QWidgetWindow: call base class close event impl||5.6||qt/qtbase||Status: MERGED||+2||0|
|125588,2||Close QWidgetWindows by closing the window||5.6||qt/qtbase||Status: MERGED||+2||0|
|125589,3||Cocoa: Don't send duplicate close events.||5.6||qt/qtbase||Status: MERGED||+2||0|
|148319,2||Revert "QWidgetWindow: call base class close event impl".||5.6.0||qt/qtbase||Status: MERGED||+2||0|
|158701,20||Unify window close behavior||dev||qt/qtbase||Status: DEFERRED||-2||0|
|158702,1||WIP: Run QWindow close logic on QWidgetWindow close.||5.7||qt/qtbase||Status: ABANDONED||-2||0|
|227398,2||QWidgetWindow: Immediately forward close events to QWindow||5.11||qt/qtbase||Status: MERGED||+2||0|