WebEngineView获取文本输入焦点
如何检测使用QML WebEngineView显示的网页上的文本字段(输入)?
我需要此信息来显示/隐藏虚拟键盘。
How can I detect focus on the text field (input) on the webpage displayed using QML WebEngineView?
I need this information to display/hide the virtual keyboard.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要通过QML WebEngineView 将文本输入重点关注所需的网页是使用 webChannel 并在您的网页上运行一些JS代码。您无需修改页面源。
QML侧:
SystemManager.cpp:包含加载和暴露QwebChannel.js来源的功能:
systemmanager.h标头exter ext and each函数:
注意: systemmanager 对象必须为暴露于qml 。
To getting text input focus on the webpage displayed via QML WebEngineView required is use WebChannel and run some js code on your webpage. You don't need to modify the page source.
QML side:
systemmanager.cpp: Contains function to load and expose qwebchannel.js source:
systemManager.h Header part with exposing function:
NOTE: The SystemManager object must be exposed to QML.