June 27, 2011

umen242 umen242
Lab Rat
198 posts

problem with the trayicon , when application is closed the icon still in the tray


Hello all
i have problem that the icon doesn’t clean it self after i close my application and make sure to clean the icon from the tray
the icon still remain there , only after i move my mouse pointer over the icon it disappear .
how can i prevent it to stay there after application closing , im using windows xp 32 sp 2?

2 replies

June 27, 2011

Gerolf Gerolf
Hobby Entomologist
3251 posts

I think, tjis is not an application problem, it’s a windows problem. I often see that for processes, I quit which have a tray icon, the icon stays there till you move the mouse over it :-(


Nokia Certified Qt Specialist.
Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

June 27, 2011

Lukas Geyer Lukas Geyer
Lab Rat
2068 posts

You have to manually hide the tray icon (for example at the closeEvent of the main window).

  1. void MainWidget::closeEvent(QCloseEvent* event)
  2. {
  3.     _systemTrayIcon->hide();
  5.     event->accept();
  6. }
… will do the trick.

  ‹‹ qt 4.8 (origin/master) documentation for src/plugins/platforms/*      [SOLVED] [N00b] Memory management in Qt ››

You must log in to post a reply. Not a member yet? Register here!