1. 安装fcitx-frontend-qt5:
sudo apt-get install fcitx-frontend-qt5
2. 这时候可以找到libfcitxplatforminputcontextplugin.so文件,我的路径是这里:
/usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so
每个人系统上的路径可能不同,我们可以通过先更新数据库ldconfig,再locate的方式查找:
$sudo ldconfig
$locate libfcitxplatforminputcontextplugin.so
/usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so
3. 查找qtcreator的安装路径中(可以用locate命令),存放动态链接库文件(.so文件)的路径,可以看到我的路径是:
/usr/lib/x86_64-linux-gnu/qtcreator/plugins/QtProject/
$locate qtcreator | grep lib | grep plugins # qtcreator可能有大小写的区别,不同系统上可能名称不同
/usr/lib/x86_64-linux-gnu/qtcreator/plugins/QtProject/libValgrind.so
/usr/lib/x86_64-linux-gnu/qtcreator/plugins/QtProject/libVcsBase.so
/usr/lib/x86_64-linux-gnu/qtcreator/plugins/QtProject/libWelcome.so
/usr/lib/x86_64-linux-gnu/qtcreator/plugins/QtProject/libfcitxplatforminputcontextplugin.so
/usr/lib/x86_64-linux-gnu/qtcreator/plugins/Sander/BareMetal.pluginspec
/usr/lib/x86_64-linux-gnu/qtcreator/plugins/Sander/libBareMetal.so
/usr/lib/x86_64-linux-gnu/qtcreator/qmldesigner/libcomponentsplugin.so
/usr/lib/x86_64-linux-gnu/qtcreator/qmldesigner/libqtquickplugin.so
...
把libfcitxplatforminputcontextplugin.so从qt5存放so文件的路径拷贝到qtcreator存放so文件的路径就可以了(使用cp命令).
cp /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so /usr/lib/x86_64-linux-gnu/qtcreator/plugins/QtProject/