QT::透明

透明窗口
如果想实现窗体部件透明效果,只需在设置背景时指定alpha值即可。
如QPushButton{background - color:rgba(255,255,255,100)}
rgba():红绿蓝透明--其中a的值为100,则会出现半透明的效果。


ui->setupUi(this);
setWindowOpacity(0.3); 
setWindowFlags(Qt::FramelessWindowHint);//在windows下指定属性,才能使窗口透明。
setAttribute(Qt::WA_TranslucentBackground);//属性:窗口透明,部件不受影响
原文地址:https://www.cnblogs.com/osbreak/p/14370254.html