title: PyQt 5.6.2 / 5.9.1 on Windows 10 - WindowStaysOnTopHint doesn't work
body: <p><em>PyQt 5.6.2, 5.9.1, Anaconda, vscode, Windows 10 x64.</em></p>
  
  <p>Setting <code>QtCore.Qt.WindowStaysOnTopHint</code> in <code>super().__init__()</code> or via <code>self.setWindowFlags()</code> does nothing. <strong>With Qt 4.8.7 (PyQt 4.11.4) the flag works as expected.</strong></p>
  
  <p>I can fix this using Windows API (<code>HWND_TOPMOST</code> flag):</p>
  
  <pre><code>import sys
  try:
      from PyQt5 import QtCore, QtWidgets
  except ImportError:
      from PyQt4 import QtCore, QtGui as QtWidgets
  
  class Form1(QtWidgets.QWidget):
      def __init__(self):
          super().__init__()
          self.pushButton1 = QtWidgets.QPushButton("Push", self)
          self.pushButton1.clicked.connect(self.clicked)
          self.ontop = False
  
      def clicked(self):
          self.ontop = not self.ontop
          self.windowStaysOnTopHint(self.ontop)
  
      def windowStaysOnTopHint(self, b=True):
          try:
              import win32gui, win32con
              flag = win32con.HWND_TOPMOST if b else win32con.HWND_NOTOPMOST
              win32gui.SetWindowPos(self.winId(), flag, 0, 0, 0, 0, win32con.SWP_NOSIZE | win32con.SWP_NOMOVE)
          except ModuleNotFoundError:
              pass
          if b:
              flag = self.windowFlags() | QtCore.Qt.WindowStaysOnTopHint
          else:
              flag = self.windowFlags() &amp; ~QtCore.Qt.WindowStaysOnTopHint
          self.setGeometry(self.geometry())  # `setWindowFlags` resets size if setGeometry is never called
          self.setWindowFlags(flag)
          self.show()
  
  print(QtCore.QT_VERSION_STR)
  app = QtWidgets.QApplication(sys.argv)
  form1 = Form1()
  form1.show()
  app.exec_()
  </code></pre>
  
  <p>I can use <code>win32gui.SetWindowPos</code> and remove <code>setWindowFlags</code> block at all. But I really want to know what's the reason of this behaviour.</p>