这是本文档旧的修订版!
在/usr/lib/里搜索libfcitxplatforminputcontextplugin.so
,
如在:/usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so
然后复制到
[Qt安装目录]/5.12.12/gcc_64/plugins/platforminputcontexts
和
[Qt安装目录]/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts
然后对每个libfcitxplatforminputcontextplugin.so加上执行权限
chmod +x libfcitxplatforminputcontextplugin.so
然后重启Qt Creator即可
但偶尔这样的操作并不生效,这就需要自己编译libfcitxplatforminputcontextplugin.so
首先去github下载fcitx-qt5源码
地址: https://github.com/fcitx/fcitx-qt5
例如Qt Creator 14.0.1,打开About Qt Creator后可以看到Based on Qt 6.7.2,所以我们要用6.7.2版本去编译
安装Qt时,可以加镜像源下载快些:
./qt-online-installer-linux-x64-4.8.0.run --mirror https://mirrors.ustc.edu.cn/qtproject/
安装依赖
sudo apt install extra-cmake-modules sudo apt install libxkbcommon-x11-dev
修改CMakeLists.txt
option(ENABLE_QT5 "Enable Qt5" Off) option(ENABLE_QT6 "Enable Qt6 im module" On) option(ENABLE_LIBRARY "Qt library" Off)
Qt环境变量
export PATH=$PATH:/opt/Qt/6.7.2/gcc_64/bin
编译安装
注意: Qt 6.9.0版本开始,需要cmake 3.22版本以上才能编译,可以安装:
apt install cmake-mozilla
cmake . -DENABLE_LIBRARY=false make
然后生成的so在qt6/platforminputcontext/libfcitxplatforminputcontextplugin-qt6.so
最后复制到qtcreator-14.0.1/lib/Qt/plugins/platforminputcontexts中即可
现象:
1) 即便重新编译了lib.so库,中文能正常输入,但是小键盘数字几乎按不出来,而且有时候会乱跳。大键盘数字正常
2) 搜索框有时候在输入一个中文词后,再输入时,会出现一两个字母后才能调出中文输入
apt install libfcitx-qt5-1
Qt Creator | Based On Qt | Used In Qt | 编译 |
---|---|---|---|
4.11.1 | 5.14.1 | 5.14.2 | |
5.0.2 | 5.15.2 | 5.12.12 | |
6.2.0 | |
||
6.2.1 | YES | ||
6.2.2 | YES | ||
6.2.3 | YES | ||
6.2.4 | YES | ||
6.3.0 | YES | ||
6.3.1 | YES | ||
6.3.2 | YES | ||
6.4.0 | YES | ||
6.4.1 | YES | ||
6.4.2 | YES | ||
6.4.3 | YES | ||
6.5.0 | YES | ||
6.5.2 | YES | ||
6.5.3 | YES | ||
6.6.0 | YES | ||
6.6.1 | YES | ||
6.6.2 | YES | ||
6.6.3 | YES | ||
6.7.0 | YES | ||
6.7.1 | YES | ||
6.7.2 | YES | ||
6.7.3 | YES | ||
6.8.0 | YES | ||
15.0.0 | 6.8.1 | YES | |
6.8.2 | YES | ||
6.8.3 | YES | ||
6.9.0 | YES | ||
17.0.0 | 6.9.1 | YES |