Hi All,

I have tried everything I can find in this forum and on the web to get this to work, and nothing seems to solve my problem.

I have a program made with QT 4.3, which should hide to the tray icon.

When I hide it using the tray icon, it works fine, even on Windows the task-bar entry goes away, leaving just the icon tray:

Qt Code:
  1. void vfalerter::iconClicked( QSystemTrayIcon::ActivationReason reason )
  2. {
  3.  
  4. if( reason == QSystemTrayIcon::Trigger ) {
  5. // The icon in the tray was clicked
  6. if(this->isVisible())
  7. this->hide();
  8. else
  9. this->showNormal();
  10. }
  11. else if( reason == QSystemTrayIcon::MiddleClick ) {
  12. // The icon was middle-clicked
  13. showPopup( statusText, 1 );
  14. }
  15. }
To copy to clipboard, switch view to plain text mode 

That part works great. But when i try and capture the Minimize event from the main window, it leaves the task bar entry there.

Qt Code:
  1. bool vfalerter::eventFilter(QObject *obj, QEvent *event)
  2. {
  3. if( event->type() == QEvent::Hide ) {
  4. // Window was minimized
  5. this->hide();
  6. return false;
  7. }
  8. else if( event->type() == QEvent::Close) {
  9. // We are exiting
  10. trayicon->hide();
  11.  
  12. // Delete any popups
  13. while( popups.count() )
  14. delPopup( popups[0] );
  15. return false;
  16. }
  17. else if( event->type() == QEvent::Show) {
  18. this->show();
  19. return false;
  20. }
  21. else {
  22. // Other events should be passed back to the main window
  23. return QObject::eventFilter(obj, event);
  24. }
  25. }
To copy to clipboard, switch view to plain text mode 

The only way I have been able to make the taskbar entry go away in Windows from the minimize button is by adding:

Qt Code:
  1. setWindowFlags( Qt::SubWindow );
To copy to clipboard, switch view to plain text mode 

..to the hide function, but then the window never comes back the way it was when I restore it, and I'm pretty sure that wouldn't be the right way of doing it.

The whole things works as expected in KDE, its just Windows that has a problem.

Anyone got any ideas?