C++ over Qt : Controlling transparency of Labels and Buttons
You can set transparency of QLabel or QPushbutton by setting the stylesheet :
ui->label->setStyleSheet("background-color: rgba(255, 255, 255, 0);");
ui->button->setStyleSheet("background-color: rgba(255, 255, 255, 0);");
You can also add background-color: rgba(255, 255, 255, 0);
to the styleSheet property of the widget in the designer.
The fourth parameter is alpha. You can also have semi-transparent widgets by setting alpha to some value more than zero :
ui->button->setStyleSheet("background-color: rgba(255, 255, 255, 50);");
There is the property "Window opacity" in the QWidget
section of the ui element property (bottom right in qtDesigner view). By default it is 1.0
(completely opaque).
It is also available programmatically