QT窗口透明问题

liyu_tiger 2011-01-12 01:23:56
我用一个dialog(A)作为播放窗口,另一dialog(B)作为控制窗口,dialog B是盖住dialog A的一小部分,怎样让dialog B窗口及其控件都透明?
setWindowOpacity(0.7)在我的liunx系统下,是无效的。
...全文
178 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
念茜 2011-01-14
  • 打赏
  • 举报
回复
无边框+png格式icon或者背景图
信念 2011-01-12
  • 打赏
  • 举报
回复

windowOpacity : double
This property holds the level of opacity for the window.
The valid range of opacity is from 1.0 (completely opaque) to 0.0 (completely transparent).
By default the value of this property is 1.0.
This feature is available on Embedded Linux, Mac OS X, Windows, and X11 platforms that support the Composite extension.
This feature is not available on Windows CE.
Note that under X11 you need to have a composite manager running, and the X11 specific _NET_WM_WINDOW_OPACITY atom needs to be supported by the window manager you are using.
Warning: Changing this property from opaque to transparent might issue a paint event that needs to be processed before the window is displayed correctly. This affects mainly the use of QPixmap::grabWindow(). Also note that semi-transparent windows update and resize significantly slower than opaque windows.
Access functions:
qreal windowOpacity () const
void setWindowOpacity ( qreal level )
See also setMask().

16,199

社区成员

发帖
与我相关
我的任务
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
  • Qt
  • 亭台六七座
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧