1.窗口整体透明,但是窗体上的控件不透明。
通过设置窗体的背景色来实现,将背景色设置为全透。



试验效果:
窗体标题栏不透明;
窗体客户区上的控件不透明,QLabel控件只是字显示,控件背景色透明;
窗体客户区完全透明。
另外从网上看到的方法:

试验的结果是类似于上面的方法,但有时候窗体会被一些杂色斑点填充,未找到原因。
2.窗口及其上面的控件都半透明:

试验效果:窗口及控件都半透明。
3.窗口整体不透明,局部透明:
在Paint事件中使用Clear模式绘图。






试验效果:绘制区域全透明。如果绘制区域有控件不会影响控件。
以上实验均是基于Directfb的Qte测试。在Linux下及Windows下效果会略有不同。
比如在Windows下第3个实验,绘制区域就是一个黑窟窿,如果Window本身半透,则是Window下面的内容加上半透效果,不是全透明效果。
本文出自 “悠然 ” 博客,请务必保留此出处http://mypyg.blog.51cto.com/820446/172661
参考:http://blog.csdn.net/seanyxie/article/details/5930779