????????今天收到一个BUG,部分苹果用户接受不到新消息弹窗,我的新消息弹窗设置了Qt::Popup属性和Qt::Tool属性,其中Qt::Popup属性在Windows平台上会使窗口在右下方弹出 ,在Macos上会使窗口在右上方弹出,测试人员反馈M1芯片的Mac用户表示正常,其他非M1芯片的Mac用户就是弹不出消息提示窗口。
????????仔细阅读帮助文档,其中有这么一句话,如下:
????????Indicates that the widget is a tool window. A tool window is often a small window with a smaller than usual title bar and decoration, typically used for collections of tool buttons. If there is a parent, the tool window will always be kept on top of it. If there isn't a parent, you may consider using Qt::WindowStaysOnTopHint as well. If the window system supports it, a tool window can be decorated with a somewhat lighter frame. It can also be combined with Qt::FramelessWindowHint. On macOS, tool windows correspond to the NSPanel class of windows. This means that the window lives on a level above normal windows making 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.
????????其中在Mac系统的默认情况下,窗口处于非活动状态时,工具窗口将消失,可以由Qt::WA_MacAlwaysShowToolWindow这一属性来控制,遂设置这一选项,问题解决,无论时隐藏进程序坞还是缩小窗口,Qt::Tool这一属性都会生效。(至于为什么M1芯片用户坞不出现这个BUG,这可能和操作系统有关,具体原因待有时间去深究)。
|