如果不求助于 WindowStaysOnTopHint,就无法让小部件出现在 Houdini 上
我正在从 3D 应用程序 (Houdini) 启动一个小部件,而我能够可靠地使小部件保持在顶部的唯一方法是...
setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
...但是,它仍然在顶部不管。有时我可以设置 Qt.Window 标志并获得所需的行为,即小部件出现在顶部,但随后可以升高或降低......但我无法始终如一地获得此行为。
该小部件不是 Houdini 应用程序的子级,它作为独立运行;因此,我不希望 raise() setActiveWindow() 等产生效果。
想法?
-谢谢
I'm launching a widget from a 3D application (Houdini) and the only way I can reliably get the widget to remain on top is to...
setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
...however, it then remains on top regardless. At times I can instead set the Qt.Window flag and get the desired behavior, ie the widget appears on top but can then be raised or lowered...but I cannot get this behavior consistently.
The widget is not a child of the Houdini application, It's running as a standalone; consequently, I don't expect raise() setActiveWindow(), etc to have an effect.
Thoughts?
-Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于允许应用程序强制自己进入前台通常被认为是不好的形式,因此您在 Qt 中找不到任何可靠的方法来执行此操作。不过,有一些特定于操作系统的方法,您可以通过搜索“qt active foreground”。
Since it is generally considered bad form to allow applications to force themselves to the foreground, you won't find any reliable way to do this in Qt. There are some OS specific methods though and you can find most of them on this site by searching for "qt active foreground".