2023-08-30 15:40:40 +08:00
|
|
|
# Qt VirtualKeyboard 支持中文
|
|
|
|
|
|
|
|
## 1. 概述
|
|
|
|
|
2023-08-30 15:52:46 +08:00
|
|
|
Qt VirtualKeyboard 不需要输入法做后端,其以插件插件形式提供功能,库安装在 <QT>/plugins/virtualkeyboard 目录下,中文拼音输入法由 qtvirtualkeyboard_pinyin.dll/qtvirtualkeyboard_pinyin.so 提供功能。
|
|
|
|
|
|
|
|
Qt VirtualKeyboard 相关目录如下:
|
|
|
|
|
|
|
|
| Item | Desktop install path | Boot2Qt install path |
|
|
|
|
|------|----------------------|----------------------|
|
|
|
|
| qtvirtualkeyboardplugin | \<QT_INSTALL_PLUGINS\>/platforminputcontexts | /system/plugins/platforminputcontexts |
|
|
|
|
| qtvirtualkeyboardextensionplugin | \<QT_INSTALL_PLUGINS\>/virtualkeyboard | /system/plugins/virtualkeyboard |
|
|
|
|
| qtvirtualkeyboardplugin QML files | \<QT_INSTALL_QML\>/QtQuick/VirtualKeyboard | /system/qml/QtQuick/VirtualKeyboard |
|
|
|
|
| qtvirtualkeyboardstylesplugin | \<QT_INSTALL_QML\>/QtQuick/VirtualKeyboard/Styles | /system/qml/QtQuick/VirtualKeyboard/Styles |
|
2023-08-30 15:40:40 +08:00
|
|
|
|
|
|
|
Ubuntu 系统 apt 安装该组件不支持中文拼音输入,需要卸载 Qt VirtualKeyboard 组件后自行通过官方源码编译安装。在 <https://download.qt.io> 的不同 official releases 中的 submodules 下可以找到不同版本的源码,例如,对应 Qt 5.15.10 的 VirtualKeyboard 下载连接如下:
|
|
|
|
|
|
|
|
- [qtvirtualkeyboard-everywhere-opensource-src-5.15.10.zip](https://download.qt.io/official_releases/qt/5.15/5.15.10/submodules/qtvirtualkeyboard-everywhere-opensource-src-5.15.10.zip)
|
|
|
|
- [qtvirtualkeyboard-everywhere-opensource-src-5.15.10.tar.xz](https://download.qt.io/official_releases/qt/5.15/5.15.10/submodules/qtvirtualkeyboard-everywhere-opensource-src-5.15.10.tar.xz)
|
|
|
|
|
|
|
|
## 2. 配置和编译
|
|
|
|
|
|
|
|
解压源码并 cd 到源码目录后:
|
|
|
|
|
|
|
|
```
|
2024-04-16 22:00:44 +08:00
|
|
|
sudo apt install libxcb-xfixes0 libxcb-xfixes0-dev
|
2023-08-30 15:40:40 +08:00
|
|
|
qmake CONFIG+="lang-en_US lang-zh_CN"
|
|
|
|
make
|
|
|
|
sudo make install
|
|
|
|
```
|
|
|
|
|
|
|
|
即可。
|