Qt Virtual Keyboard
Qt Virtual Keyboard 项目为Linux桌面/X11、Windows桌面以及Boot2Qt目标平台上的Qt 6提供了输入框架和参考键盘前端。
该输入框架使编写自定义输入法或集成第三方输入引擎变得十分简单。输入法可以使用 C++ 或 QML 实现。
使用该模块
要使用 Qt 模块的 C++ API,需要将模块库链接到项目中,既可以直接链接,也可以通过其他依赖项间接链接。包括CMake和qmake 在内的多种构建工具都为此提供了专门的支持。
使用 CMake 构建
使用find_package() 命令在Qt6 包中定位所需的模块组件:
find_package(Qt6 REQUIRED COMPONENTS VirtualKeyboard)
target_link_libraries(mytarget PRIVATE Qt6::VirtualKeyboard)更多详细信息,请参阅“使用 CMake 构建”概述。
使用 qmake 进行构建
要配置模块以供 qmake 构建,请在项目的 .pro 文件中将该模块作为QT 变量的值添加:
QT += virtualkeyboard文章与指南
示例
参考
- Qt Virtual Keyboard 应用程序 API
- Qt Virtual Keyboard 用于高级用例的 API
- Qt Virtual Keyboard QML 类型
- Qt Virtual Keyboard C++ Classes
许可与归属
Qt Virtual Keyboard 由The Qt Company 提供商业许可。此外,它还遵循GNU 通用公共许可证第 3 版。更多详细信息请参阅Qt 许可。
此外,Qt Virtual Keyboard 可能包含遵循以下宽松许可协议的第三方模块:
Apache 2.0 许可证 | |
Apache 2.0 许可证 | |
Apache 2.0 许可协议和 BSD 三条款“新”或“修订”许可协议 |
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.