Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QSystemTrayIcon Context menu on macOS disabled after updating to Qt5.15.2
Re: QSystemTrayIcon: Menu gets disabled if no window has focus
I'm facing similar problem as described in the topic above.
On macOS tray icon menu is greyed out and actions are not enabled when I click on any of them. We use Cocoa plugin and implement AppDelegate to handle dock clicks and main menu clicks. AppDelegate is set before the creation of QApplication, and the tray icon's context menu is disabled all the time (i.e. when application windows are not active or active).
It works when building with Qt5.8.0 on macOS 10.15 and macOS 11.0.
The simple tray icon context menu created in a small app works with Qt5.15.2.
Hi and welcome to devnet,
Can you provide a minimal compilable example that shows that issue ?
Thank you, it was the same cause as described in the topic linked in the first post. I overlooked it at first and thought the Cocoa initialization happened before QApplication, whereas it wasn't.
So you mean you got it working ?
Yes, I got it working correctly.
Then please mark you thread as solved :-)