title: Can't set transparency of QWindow after shown once while opaque
body: <p>I have a window I'm trying to make transparent after being shown once while opaque. However, doesn't go transparent even if I hide and show again. This is what I get:</p>
  
  <p><a href="https://i.stack.imgur.com/N4tJi.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N4tJi.jpg" alt="Black background"></a></p>
  
  <p>But I want it like this: (transparent against background)</p>
  
  <p><a href="https://i.stack.imgur.com/Kq6LW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kq6LW.jpg" alt="Transparent Background"></a></p>
  
  <p>If I run <code>WA_TranslucentBackground</code> first, <em>before</em> <code>.show()</code> it creates a nice transparent button as expected.</p>
  
  <p>Here is an example code which shows a floating button when you run it</p>
  
  <pre><code>import sys
  from PySide2 import QtCore, QtWidgets, QtGui
  
  class TransparentWindow(QtWidgets.QMainWindow):
      def __init__(self):
          super(TransparentWindow, self).__init__()
          self.setCentralWidget(QtWidgets.QWidget(self))
          self.mainLayout = QtWidgets.QVBoxLayout()
          self.centralWidget().setLayout(self.mainLayout)
          self.mainLayout.addWidget(QtWidgets.QPushButton("Hello World", parent=self))
          self.setWindowFlags(self.windowFlags() | QtCore.Qt.FramelessWindowHint)
  
          self.show() # If I move this under '.setAttribute()' it works
          self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
  
  
  if __name__ == "__main__":
      app = QtWidgets.QApplication(sys.argv)
      demo = TransparentWindow()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>I've tried hiding and reshowing, 'setAutoFillBackground()' and 'WA_NoSystemBackground' attribute, but I cant seem to get it to work. Anybody have any idea how to set the transparency after it has been shown as opaque?</p>
  
  <p>Using versions QtCore: 5.9.6, Pyside2: 5.9.0a1.dev1528389443</p>