Hello! I want to implement a simple function to toggle normal window/on top state. For this, I write this code:
Qt Code:
  1. Qt::WindowFlags f = 0;
  2.  
  3. Qt::WindowFlags flags = windowFlags ();
  4. if (flags & Qt::WindowStaysOnTopHint)
  5. f = Qt::Window;
  6. else
  7. {
  8. f = Qt::Window;
  9. f |= Qt::WindowStaysOnTopHint;
  10. }
  11. setWindowFlags (f);
To copy to clipboard, switch view to plain text mode 
But when I run it, the window just disappears.