透明窗口
如果想实现窗体部件透明效果,只需在设置背景时指定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);//属性:窗口透明,部件不受影响

 

相关文章:

  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
  • 2021-10-07
  • 2021-12-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-26
  • 2021-10-18
  • 2021-09-14
  • 2022-12-23
  • 2022-01-22
相关资源
相似解决方案