Qt 全屏窗口隐藏 Win8/10 触摸键盘 [英] Qt Fullscreen Window hiding Win8/10 touch keyboard

查看:42
本文介绍了Qt 全屏窗口隐藏 Win8/10 触摸键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试将 Windows 触摸键盘 (TabTip.exe) 保留在 全屏 Qt QML 应用程序上.

I'm currently trying to keep the Windows Touch Keyboard (TabTip.exe) over a fullscreen Qt QML application.

不幸的是,在展示(并强迫它位于顶部)后,它再次被驳回.

Unfortunately, after showing (and forcing it to be on top) it's dismissed again.

无论我是在启动应用程序之前启动键盘还是在全屏运行应用程序时启动键盘,Qt 获得焦点后,键盘都在后面.

It does not matter if I start the keyboard before starting the application or while running the application in fullscreen, after Qt is gaining focus, the keyboard is behind.

任何想法这会导致什么?这是 Qt 还是 Windows 问题?

Any ideas what this could cause? Is this a Qt or Windows issue?

推荐答案

我找到了一种将 Windows 键盘保持在 QML全屏"应用程序上方的方法.我注意到的是,在非全屏应用程序中,键盘显示在我的 QML 应用程序上方.所以我们的想法是模拟一个全屏应用程序,使窗口应用程序几乎与屏幕一样大.一些代码会更好:

I found a way to keep the Windows keyboard above my QML "fullscreen" application. What I noticed is that in non fullscreen application, the keyboard appears well above my QML application. So the idea was to simulate a fullscreen application giving the window application nearly the size of the screen. Some code will be better:

ApplicationWindow {
  id: mainWindow

  x: 0
  y: 0
  width: Screen.width
  height: Screen.height + 1 //+1 because does not work if the window size is equal to screen resolution. In some way, it considers it's a real fullscreen application and the keyboard stays behind.

  flags: Qt.FramelessWindowHint | Qt.Window //first flag to remove top right buttons such as close button, second flag to keep the application thumbnail in the Windows taskbar to close it if necessary.

  visible: true
  ...
}

有了这个,我可以打开窗口键盘,点击一个文本字段,关闭它,重新打开它,......我想要的一切!

With that, I can open the Windowd keyboard clicking on a text field, close it, re open it, ... all that I want!

这篇关于Qt 全屏窗口隐藏 Win8/10 触摸键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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