I have an action in my QMainWindow, mainWindow1, that will show another QMainWindow which is a child of mainWindow1, I wanted to show this second mainwindow in a Non-Modal fashion, but its just wont go away in front of my mainWindow1 . The second QMainWindow is not blocking input on my mainWindow1 in any case but it keeps itself in front of my mainWindow1 even if click my mouse to mainWindow1.

Qt Code:
  1. //in my mainwindow 1 i poped the other mainwindow like this
  2.  
  3. if (m_mainWindow2 == NULL)
  4. {
  5. m_mainWindow2 = new QMainWindow(this);
  6. }
  7.  
  8. m_mainWindow2 ->show();
To copy to clipboard, switch view to plain text mode 

I tried playing with the windowFlags and windowModality with no luck .... anybody please help..

baray98