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);//属性:窗口透明,部件不受影响

 

posted @ 2021-02-03 23:04  osbreak  阅读(74)  评论(0编辑  收藏  举报