Qt closing tray icon after stopping the application

I have a little problem with the tray icon under the windows. After closing the Qt application (normal exit), the icon still remains in the system panel. It disappears only when I click on it with the mouse cursor. I tried to hide it in the destructor of my window, but it failed: I tried .setVisible(false) .

Any ideas? Thanks.

PS I remember that I had the same problem with SWT / Java.

+7
source share
2 answers

I would not hide it in the destructor. This will probably be the wrong link at that time. I would place it where your Exit event takes place.

+6
source

If you cannot call it from the destructor, you can connect the signal QCoreApplication::aboutToQuit() to QSystemTrayIcon::hide() .

+3
source

All Articles