Yocto中的虚拟键盘顶部黑屏 [英] Virtual keyboard top black screen in Yocto

查看:43
本文介绍了Yocto中的虚拟键盘顶部黑屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用在 Yocto Sumo 中开发的 VAR-SOM-MX7 开发设备.我设法将虚拟键盘添加到我的 QApplication 中,但是当键盘出现时,它与应用程序重叠.textEdit 字段仍然从虚拟键盘获取输入,但在键入时无法显示 textEdit 字段.

I am developing a device using VAR-SOM-MX7 developing in Yocto Sumo. I managed to add virtual keyboard into my QApplication but when the keyboard appeared, it overlaps the application. The textEdit field still getting the input from the virtual keyboard but just cannot show the textEdit field while typing.

我曾尝试:

qputenv("QMLSCENE_DEVICE", QByteArray("softwarecontext"))

CONFIG += disable-desktop

在 qml 中我改变了键盘布局:

In qml I changed the keyboard layout:

keyboardBackground: Rectangle {
   color: "transparent"
}

但我的应用程序顶部仍然出现黑屏.

But still I am getting black screen on top overlapping my application.

推荐答案

经过长时间的尝试,我终于找到了解决此问题的方法.虚拟键盘是使用另一个 QQuickWindow 创建的,这个窗口与我的 QWidget 应用程序窗口重叠.我只需要找到vk窗口,并使用QWindow setMask函数来屏蔽黑色区域.

After long try, I finally found a solution to solve this issue. The virtual keyboard was created using another QQuickWindow and this window overlap my QWidget application window. I just have to find the vk window, and use the QWindow setMask function to mask of the black region.

希望这也能帮助其他人,因为我在网上找不到任何其他解决方案.

Hope this can help others too since I couldn't find any other solution online on this matter.

这篇关于Yocto中的虚拟键盘顶部黑屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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