How to adjust the transparency of the main window on QT? Do I need an attribute or style?I tried to set the opacity, but it did not work for me.
app.setStyleSheet("QMainWindow {opacity:0}")
you must set a new attribute for the MainWindow object, as shown below:
class Main(QtGui.QMainWindow): def __init__(self): self.setAttribute(Qt.WA_TranslucentBackground)
Just use the property windowOpacity:
windowOpacity
http://doc.qt.io/qt-4.8/qwidget.html#windowOpacity-prop