arm qt quick 打不开png,Qt不加载JPG,仅加载PNG

在Windows 7 64位系统上使用Visual Studio 2008开发项目时,遇到一个问题:只有PNG图片可以正常加载,而JPG和其他格式无法显示。问题在于缺少Qt的jpg插件。解决方法是将Qt安装目录下的`imageformats`文件夹复制到可执行文件路径下,确保加载jpg插件。同时,检查环境变量设置,确保与同事的配置一致。
摘要由CSDN通过智能技术生成

I work with my colleagues on the same project on Windows 7 64 bit version, Visual Studio 2008.

They load JPG and they work. Through QPixmap and Stylesheets. And works.

But for me, i can only work with PNG, the rest don´t work at all.

I also tried to change paths on the environment variables, but i only see one Qt path (the bin) on it. Nothing about plugins, i guess... as i read on the documentation:

"By default, Qt can read the following formats:

Format Description

BMP Windows Bitmap

GIF Graphic Interchange Format (optional)

JPG Joint Photographic Experts Group

JPEG Joint Photographic Experts Group

MNG Multiple-image Network Graphics

PNG Portable Network Graphics

PBM Portable Bitmap

PGM Portable Graymap

(...)"

I wonder what does "optional" means?.

解决方案

Your executable is missing the jpg plugin. Optional means, that if your executable doesn't find the plugins (dlls) it will start, but without loading these image formats. It is the same with a lot of qt features (fe: slqdrivers)

You will find the folder "imageformats" in C:\Qt\4.8.4\plugins (replace your installation dir and version), copy it to your executable path and it will show jpgs.

Probably, some environmental variables of your colleagues differ a bit from yours.

Take care with Qt plugins and the distribution of your application.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值