本页内容

Qt Virtual Keyboard C++ Classes

提供用于实现虚拟键盘输入法的类。更多...

命名空间

QtVirtualKeyboard

包含虚拟键盘类所使用的枚举

类

QVirtualKeyboardAbstractInputMethod

输入法的基类

QVirtualKeyboardDictionary

用于虚拟键盘输入法的应用程序自定义词典

QVirtualKeyboardDictionaryManager

用于应用程序定义词典的词典管理

QVirtualKeyboardInputContext

提供对输入上下文的访问

QVirtualKeyboardInputEngine

InputEngine 类提供了一个支持 C++ 和 QML 集成的输入引擎

QVirtualKeyboardObserver

作为键盘事件通知的枢纽

QVirtualKeyboardSelectionListModel

用于选择列表的列表模型

QVirtualKeyboardTrace

Trace 是用于触摸输入数据的数据模型

详细说明

要包含该模块中类的定义,请使用以下指令:

#include <QtVirtualKeyboard>

使用该模块

使用 Qt 模块需要与该模块库进行链接,既可以直接链接,也可以通过其他依赖项间接链接。包括CMake和qmake 在内的多种构建工具都为此提供了专门的支持。

使用 CMake 构建

使用find_package() 命令在Qt6 软件包中定位所需的模块组件:

find_package(Qt6 REQUIRED COMPONENTS VirtualKeyboard)
target_link_libraries(mytarget PRIVATE Qt6::VirtualKeyboard)

更多信息请参阅《CMake 入门指南》。

使用 qmake 构建

要链接到此模块,请在您的 qmake.pro 文件中添加以下行:

QT += virtualkeyboard

© 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.