deepin系统安装QT和解决无法输入中文的问题

如何在deepin系统中安装指定版本的QT

步骤一:进入下载QT版本页面

QT下载网站

http://download.qt.io/archive/qt/

选择对应的版本,该文档就以5.14.2为例做演示
在这里插入图片描述

步骤二:选择对应的版本

这里选择5.14.2版本,点击进去。
在这里插入图片描述

选择qt-opensource-linux-x64-5.14.2.run,进行下载
在这里插入图片描述

步骤三:运行qt-opensource-linux-x64-5.14.2.run,安装QT

先执行:

#给权限可执行权限给qt-opensource-linux-x64-5.14.2.run
sudo chmod +x qt-opensource-linux-x64-5.14.2.run

#运行qt-opensource-linux-x64-5.14.2.run
./qt-opensource-linux-x64-5.14.2.run

后面就一顿安装QT,全部选择 同意即可。

步骤四:解决QT无法输入中文的问题

1.安装依赖

sudo apt install git cmake extra-cmake-modules gcc g++ libxkbcommon-dev

2.获取fcitx-qt5源代码

git clone https://github.com/fcitx/fcitx-qt5

3.进入该目录

cd fcitx-qt5

4.修改CMakeLists.txt

# 要支持哪个就打开哪个,我这里编译Qt5的输入支持模块
option(ENABLE_QT5 "Enable Qt5" On)
option(ENABLE_QT6 "Enable Qt6 im module" Off)
option(ENABLE_LIBRARY "Qt library" Off)

5.编译

#在终端输入命令导入你的qt5路径  
export PATH="/home/yjh/Qt5.14.2/5.14.2/gcc_64/bin":$PATH
# 这是我的qt安装目录,要根据自己情况修改
mkdir build && cd build
cmake .. -DENABLE_LIBRARY=false
make -j12

6.查看是否有动态库文件

cd qt6/platforminputcontext
ls
#查看是否有libfcitxplatforminputcontextplugin.so这个库文件

7.移植库文件
注意查看自己安装QT的路径,以下命令要根据自己的文件路径来修改

#拷贝该库到QT文件夹中
cp /home/yjh/Desktop/fcitx-qt5/build/qt5/platforminputcontext/libfcitxplatforminputcontextplugin.so  /home/yjh/Qt5.14.2/5.14.2/gcc_64/plugins/platforminputcontexts

#给可执行权限
chmod +x /home/yjh/Qt5.14.2/5.14.2/gcc_64/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so

cp /home/yjh/Desktop/fcitx-qt5/build/qt5/platforminputcontext/libfcitxplatforminputcontextplugin.so  /home/yjh/Qt5.14.2/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts

chmod +x /home/yjh/Qt5.14.2/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so

步骤五:重新打开QT运行即可

如果步骤四编译失败,或者懒的搞的话,可直接在这里下载qt5.14.2的库文件

链接: https://pan.baidu.com/s/1lXwVbqg7vUREDefmSKjDCg?pwd=1234 提取码: 1234

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值