如何在 Solaris CDE 中使非模式对话框保持在其父级之上
我在使用 CDE(通用桌面环境)的 Solaris 8/10 计算机中遇到 Qt 无模式对话框问题。
该对话框充当绘图面板/弹出窗口,要求用户在继续绘图之前从主应用程序中选择工具。问题是,每当用户单击主应用程序工具栏时,该对话框就会位于主应用程序后面。
请注意,这仅与 CDE 相关,Open Windows 环境或 Solaris Java 环境不会导致此问题。
我的问题是如何使其始终位于其父级(主应用程序)之上?
我尝试将 WX11BypassWM 标志传递给对话框,以绕过窗口管理器,但随后边框和框架消失,导致对话框无法拖动/移动。
更新1:
关于Andy 的回答:
我尝试过 Qt::WStyle_StaysOnTop
,但它不起作用。
我还尝试组合:
WX11BypassWM | WStyle_StaysOnTop | WStyle_StaysOnTop | WStyle_Title
以及 WStyle_DialogBorder、WType_TopLevel
等的其他组合,只有在传入 WX11BypassWM
时,它才会保持在顶部。
但是每当 WX11BypassWM
被传入时,它就会保持在顶部。传入后,显示的对话框将没有边框,也没有标题栏。
这意味着它是一个不可移动的无标题对话框。
更新2:
由于我暂时找不到此问题的解决方案,因此我通过调整主应用程序和非模式对话框的大小和位置并排放置来解决它。
这至少可以让用户在两个界面中导航。
如果有人有更好的建议请告诉我。
I have a problem with Qt modeless dialog in Solaris 8/10 machine using CDE (Common Desktop Environment).
The dialog serve as drawing panel/popup that required user to choose the tools from main application before proceeding to draw on it. The problem is whenever user click on main application toolbar, then the dialog will goes behind the main application.
Notice that this is the behavior pertaining to CDE only, Open Windows enviroment or Solaris Java environment don't cause this issue.
My question is how can I make it always on top of its parent (main application)?
I've tried to pass in WX11BypassWM flag to the dialog, to by pass window manager, but then the border and frame is gone which cause the dialog to not drag/move-able.
Update 1:
With regard to Andy's answer:
I've tried Qt::WStyle_StaysOnTop
, but it doesn't work.
I tried also to combine:
WX11BypassWM | WStyle_StaysOnTop | WStyle_Title
and other combinationa of WStyle_DialogBorder, WType_TopLevel
etc, it only stays on top if WX11BypassWM
is passed in.
But whenever WX11BypassWM
is passed in, the dialog shown up will not have border nor the tittle bar.
Which means it's a unmove-able tittle-less dialog.
Update 2:
Since I can't find a solution for this issue, for the time being, I resolve it by resizing and reposition the main application and the modeless dialog to be side by side.
This at least will let user navigate in both interface.
Anyone if has a better suggestion then let me know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定我是否理解你的问题,但是,是否可以使用:
在 QtAssistant 中找到:
Qt::WindowStaysOnTopHint:
“通知窗口系统窗口应保留在其顶部所有其他窗口。”
我希望它有一点帮助!
I'm not sure I understood your question, but, wouldn't it be possible to use :
Found in QtAssistant :
Qt::WindowStaysOnTopHint :
"Informs the window system that the window should stay on top of all other windows."
I hope it helps a bit !