Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.0, 5.7.0, 5.12.0 Beta 4
-
macOS 10.6.7, Qt Cocoa 4.7.0, macOS 10.11 Qt 5.7
-
-
35713ef3fffeb7476a8a72490caeffbda81c4f09 (qt/qtbase/wip/cmake)
-
Bug Fixing Week Q2/2020
Description
To track shutdown/log off event in a Qt Application.
As Qt doesn't provide anything for track above events, NSWorkspace is used by registering notification for Shutdown/log out (NSWorkspaceWillPowerOffNotification). It is not working with Qt Cocoa application.
Some other notifications like Sleep, Wake as NSWorkspaceWillSleepNotification, NSWorkspaceDidWakeNotification respectively are also registered and they are working fine with Qt
To test notification registration code, same code to register with default notification center is used with simple Cocoa application (not using Qt) and it works fine as all notifications for sleep, wake, sleep/logout are received by user.
Sample code has been attached as ShutDownTrackerQt.zip(notifications not received) and ShutDownTrackerCocoa.zip (notifications received)
Attachments
For Gerrit Dashboard: QTBUG-18624 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
276330,4 | macOS: Don't override event handler for kAEQuitApplication | 5.14 | qt/qtbase | Status: MERGED | +2 | 0 |