Hey guys. I have this app that the user can choose if he/she wants it always on top or not via a menu option. This is a chackable menu action that toggles the following method:

Qt Code:
  1. void MainForm::menuAlwaysOnTop(bool bEnable)
  2. {
  3. if (bEnable == true)
  4. {
  5. // This line is hiding my window :(
  6. setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
  7. }
  8. else
  9. {
  10. // remove Qt::WindowStaysOnTopHint
  11. }
  12. }
To copy to clipboard, switch view to plain text mode 

My MainForm class derives from QMainWindow. The problem I am having is that when this method runs... my window disappears! Augh. I can't explain why. Does anyone have an idea of what I can do to fix this?