Qt小部件和软件输入面板必须都保持在顶部 [英] Qt widget and Software Input Panel must both remain on top

查看:249
本文介绍了Qt小部件和软件输入面板必须都保持在顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Qt对话框窗口,其中包含 QPlainTextEdit 小部件,为此我创建了一个软件输入面板(SIP),下面的例子此处。对话窗口的功能要求它保持在顶部。因此,SIP也必须保持在顶部 - 但是覆盖对话。我发现的问题是:

I've got a Qt dialog window that contains a QPlainTextEdit widget, for which I've created a Software Input Panel (SIP), following the example here. The function of the dialog window requires it to remain on top. As such, the SIP too must remain on top -- but overlaying the dialog. The problem I find is that:


  1. 如果我设置 Qt :: WindowStaysOnTopHint

  2. 如果我在SIP上只设置了 Qt :: WindowStaysOnTopHint 如果我在对话框 SIP上设置 Qt :: WindowStaysOnTopHint ,显然 Qt :: WindowStaysOnTopHint 仅适用于一个窗口小部件。

  1. If I set Qt::WindowStaysOnTopHint on the dialog only the SIP falls behind it.
  2. If I set Qt::WindowStaysOnTopHint on the SIP only the dialog window that can now be eclipsed by other windows, same thing happens if I set Qt::WindowStaysOnTopHint on the dialog and SIP, clearly Qt::WindowStaysOnTopHint is applicable to one widget only.

可以做什么来确保对话框堆栈在这个顺序?使用SIP模态不是一个选择或良好的解决方案。

What can be done to ensure that the dialogs stack in this order? Making the SIP modal is not really an option or good solution.

如果重要的是我在C ++中编码

If it matters I'm coding in C++

PS
请参阅我对的追踪问题

推荐答案

我找到了一个解决方法。我在SIP和主对话框上设置 Qt :: WindowStaysOnTopHint ,但是将SIP移动到主对话框的下面,以便SIP不被其遮挡。

I've found a workaround. I set Qt::WindowStaysOnTopHint on the SIP and main dialog, but move the SIP just below the main dialog, so that the SIP is not occluded by it.

这篇关于Qt小部件和软件输入面板必须都保持在顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆