当前位置:网站首页>deepin系统中Qt5.12无法输入中文(无法切换中文输入法)解决办法
deepin系统中Qt5.12无法输入中文(无法切换中文输入法)解决办法
2022-06-13 10:06:00 【只是个~小不点】
一.出现的问题
昨天安装了过程deepin系统来进行QT开发,一切进展都还顺利,但是在输入中文时,怎么切换都无法输入,也就是无法切换中文输入法,输入法状态变为默认键盘别且切换输入法的任何操作都不起作用 。昨天头疼了一下午,都弄不得。
二.为什么会出现这种问题呢?
对于使用 fcitx 框架的中文输入法,需要手动编译 fcitx-qt5 生成中文输入法的库文件,qt里面没有配置,需要在qt的某些目录下配置好这些文件才行。
查资料看到很多人用git clone github下的下载fcitx-qt5.git,但是我的电脑不行
git clone https://github.com/fcitx/fcitx-qt5.git

回去后我就用我自己的电脑远程登录我的阿里云服务器,远程使用这个命令进行下载,下载完成后,我把下载的文件拷贝到我的电脑里,然后上传QQ邮箱。
我直接把这个插件放在网盘链接下:出现想我这种问题的,直接下载就行了
链接: https://pan.baidu.com/s/1gP1LQr_W7lR9O7x4wcgYcA
提取码: 8ypp
第二天回公司后,马上登录QQ邮箱,将fcitx-qt5,下载到deepin系统中,按照以下步骤进行编译:
对于使用 fcitx 框架的中文输入法(如搜狗输入法),需要手动编译 fcitx-qt5 生成中文输入法的库文件
三.怎么解决呢?
1. 安装 cmake,用于编译 fcitx-qt5
首先查看是否已经安装 cmake:
cmake --verison如果有显示版本信息说明已经安装,则可以到下一步;如果没有安装,则先安装:
sudo apt install cmake2. 安装 fcitx-libs-dev
sudo apt install fcitx-libs-dev3.下载完fcitx-qt5后,解压fcitx-qt5
4.进入fcitx-qt5解压目录
cd fcitx-qt55. 设置 qmake 环境变量
export PATH="$HOME/Qt/Qt5.12.0/5.12.0/gcc_64/bin":$PATH注意:具体路径根据自己安装目录确定
6. 生成makefile文件
cmake .如果出现了如下图所示的结果,就成功了,可以跳过下面的步骤

如果发生错误了,注意查看错误信息

像我的就是缺少了如图所示路径中的文件libcomposeplatforminputcontextplugin.so
我们直接去系统中找一下,看其他地方有没有
用find命令
find / -name libcomposeplatforminputcontextplugin.so
然后将找到的libcomposeplatforminputcontextplugin.so库文件拷贝到,报错提示缺少的路径中
再次执行
cmake .看看错误提示,少什么,在系统目录中用find命令找就行了,直到没有报错,如下图所示

这样就算cmake成功,成功生成makefile文件
7.编译
make
能编译到100%,说明编译成功了
我们查看ficitx-qt5的目录,发现生成了qt5和qt6两个的两个文件
因为我用的是qt5.12.0版本的Qt,所以我要用的是qt5目录下的libfcitxplatforminputcontextplugin.so库文件

8.拷贝到Qt指定的两个目录中
cp -f libfcitxplatforminputcontextplugin.so /home/yicaobao/Qt5.12.0/5.12.0/gcc_64/plugins/platforminputcontexts/cp -f libfcitxplatforminputcontextplugin.so /home/yicaobao/Qt5.12.0/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts注意:具体路径根据自己安装目录确定
ok, 一切打开告成!
9. 重启Qt,即可

边栏推荐
猜你喜欢

Blue Bridge Cup group 2021a - two way sorting
![[51nod p3058] Xiao ming'ai set [set]](/img/a8/dbe6d4ed5881a757780700143e0526.jpg)
[51nod p3058] Xiao ming'ai set [set]

Tree and binary tree: storage structure of binary tree
![[51nod p3395] n-bit gray code [bit operation]](/img/91/e127e68ae2897933b795414d50c70f.jpg)
[51nod p3395] n-bit gray code [bit operation]

Win7 cannot be remote desktop problem

Node-RED系列(二四):在Node-RED中使用mysql节点实现数据库的增删改查

聊聊 C# 方法重载的底层玩法

Introduction to knowledge map

基于单片机的简易电子钟设计

Cynthia項目缺陷管理系統
随机推荐
[51nod 3062] n queen problem V2 [bit operation DFS]
Webrtc server engineering practice and optimization exploration
多线程 从UE4的无锁队列开始 (线程安全)
WIN7无法被远程桌面问题
微信小程序客服自动回复——PHP实现
类文件结构和类加载过程执行引擎简述
ThingsBoard教程(二十):使用规则链过滤遥测数据
Class and object -- friend
二叉树简介
简述请求过程
List list
[51nod P3210] binary statistics
[51nod p3058] Xiao ming'ai set [set]
Idea life extension plug-in
[51nod p3111] xiaoming'ai intercepts [Las]
[51nod p2673] shortest path [heap optimization Dijk]
[image denoising] image denoising based on MATLAB Gaussian + mean + median + bilateral filtering [including Matlab source code 1872]
Talk about the bottom playing method of C # method overloading
Chapter I Section I
说说MySQL索引机制