• 4812阅读
  • 3回复

[提问]Mac上使用Qt::Tool (Qt5)会出错 [复制链接]

上一主题 下一主题
离线harris
 
只看楼主 倒序阅读 楼主  发表于: 2014-01-02
关键词: MacTool
因为是图形工作软件,工作区域使用的是QGraphicsView,这样就导致了加入其它widget的时候设置不了透明度,只有采取设置
  1. setWindowFlags(Qt::FramelessWindowHint | Qt::Tool);

设置为popup类型的子窗口
这样设置在Qt4下面没有问题,使用Qt5的时候Window上没有问题,但是在Mac上会出现透明的时候会出现阴影,多点几次基本就看不清了,拖动主窗口也会死掉。
请问在Qt5的时候需要设置什么吗?谢谢!
离线hehui

只看该作者 1楼 发表于: 2014-01-03
void    setWindowOpacity(qreal level)
这个函数没效果么?
离线harris
只看该作者 2楼 发表于: 2014-01-03
回 1楼(hehui) 的帖子
如果直接设置QGraphicView为父类,通过设置window opacity没有效果。如果把widget通过代理的方式加入到场景中,可以通过setWindowOpacity设置,但是通过代理加入的方式,会影响性能。
离线rophie

只看该作者 3楼 发表于: 2014-01-07
On Mac OS X, tool windows correspond to the Floating class of windows. This means that the window lives on a level above normal windows; it impossible to put a normal window on top of it. By default, tool windows will disappear when the application is inactive. This can be controlled by the Qt::WA_MacAlwaysShowToolWindow attribute.
快速回复
限100 字节
 
上一个 下一个