I have read some previous posts on this, and some other articles on the subject... but am still having a problem. I am using 4.2.2 and don't know if 4.3.1 would fix it.

Essentially I have a window that derives from QMainWindow and is using a QSystemTrayIcon component. I am over-riding eventClose(...) to hide my window and show my systray icon. Double clicking the icon raise()es and activateWindows()s my main window. The problem is on minimize...

I tried over-riding event(...) and changeEvent(...). I hide my windows, show my icon and boom... something retarded happens. My windows is inactivated and sitting on my task bar. Overridding event(..) and calling hide() seems to work when I walk through it, but when it returns it adds my app back on to the task bar. I have tried to ignore the event and everything. Sounds like a bug in 4.2.2 to me, but I wanted to see what you guys think.

Here is some example code:

Qt Code:
  1. // tried a similar approach with event(QEvent*).. ignoring the event, etc.
  2. void CINQtMainWindow::changeEvent(QEvent * e )
  3. {
  4. if (e->type() == QEvent::WindowStateChange)
  5. {
  6. if (isMinimized() == true)
  7. {
  8. hide();
  9. m_oSysTray.ShowIcon();
  10.  
  11. return;
  12. }
  13. }
  14.  
  15. QMainWindow::changeEvent( e );
  16. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. void CINQtMainWindow::slotSysTrayDblClk()
  2. {
  3. m_oSysTray.HideIcon();
  4.  
  5. raise();
  6. activateWindow();
  7.  
  8. show();
  9. }
To copy to clipboard, switch view to plain text mode 

When slotSysTrayDblClk() gets called after minimizing... my app does not get raised, but sits in the task bar. When the app is minimized, you can click it on the task bar and it will show an inactivated window (essentially a black box).

4.2.2 bug? Fixed in 4.3.x?