Linux下Qt开发遇到的问题总结

QtCreator中无法输入汉字

1. 安装fcitx-frontend-qt5

sudo apt install fcitx-frontend-qt5

2. 将fcitx中的 libfcitxplatforminputcontextplugin.so 拷贝到QtCreator安装目录下并给予权限

# cd到qt安装目录下的该文件夹中
cd /opt/qt安装目录/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts

sudo cp /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so .

sudo chmod +x libfcitxplatforminputcontextplugin.so

3. 重启QtCreator

双击.pro文件无法打开Qt项目

右键该.pro文件,选择Open With Other Application,然后找到Qt Creator

打包后运行时出现错误:qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem...

sudo apt-get install libxcb-xinerama0

打开QtCreator时报LLVM ERROR: Cannot select: intrinsic %llvm.x86.sse41.pblendvb

如果是在虚拟机下报的这个错,在VMWare的设置中打开3D加速即可。如果是在实体机器中,则更新显卡驱动。

打包时没有windeploy

在windows上,Qt自带了一个windeployqt的工具,可以寻找出当前程序用了那些dll,并把需要的dll都拷贝到文件夹里,但是在linux下官方好像并没有提供这个工具。

第三方的工具有linuxdeployqt,地址如下:GitHub - probonopd/linuxdeployqt: Makes Linux applications self-contained by copying in the libraries and plugins that the application uses, and optionally generates an AppImage. Can be used for Qt and other applications

待补充...

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值