You can set the 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); in the styleSheet property of the widget in the constructor.
The fourth parameter is alpha. You can also have translucent widgets by setting alpha for some value greater than zero:
ui->button->setStyleSheet("background-color: rgba(255, 255, 255, 50);");
Nejat
source share