I try to make the background of my window transparent. But under widgets which are on it i see parts of my desktop-image. Now i have this in constructor:
self.setFocusPolicy(Qt.StrongFocus) self.setAttribute(Qt.WA_QuitOnClose,True) self.setBackgroundRole(QtGui.QPalette.Base) self.setAttribute(Qt.WA_NoSystemBackground)
Further to gs’s answer, this faq explains why (before Qt 4.5) you cannot achieve this:
FAQ Link:
Remember, PyQt’s most recent version was created against Qt 4.4, and so does not support the semi-transparent window you desire. gs’s other answer, about setAutoFillBackground(True) would work if you were setting the background colour of your main window to anything other than transparent.
Also, see the documentation for Qt.WA_NoSystemBackground, it says you can’t depend on the transparent effect that you have so far had:
Qt::WA_NoSystemBackground