1. 设置主窗体透明
设置窗体的透明的属性为 setAttribute(Qt::WA_TranslucentBackground, true);
设置窗体的透明的属性为 setAttribute(Qt::WA_TranslucentBackground, true);
但 同时 需要设置 curFlags |= Qt::FramelessWindowHint; 否则窗体会显示为黑色
2. 设置窗体透明度 : this->setWindowOpacity(0.3);
但 实际需求时,应该设置停靠在Parent 上的控件的透明度, 则 可通过样式表来设置
setStyleSheet("background-color:transparent");