我想在windows下面实现一个窗口的背景透明,类似ubuntu的终端那样,只有背景透明,而标题栏,菜单栏则不受影响。
在网上查找了西面的代码:
QWidget w;
QPalette myPalette;
QColor myColor(0,0,0);
myColor.setAlphaF(0.2);
myPalette.setBrush(w.backgroundRole(),myColor);
w.setPalette(myPalette);
w.setAutoFillBackground(true);
但是使用之后背景整个变成黑色的了,这个问题如何解决。