日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 前端技术 > HTML >内容正文

HTML

qt 利用 HTML 生成PDF文档,不能显示jpg图片

發(fā)布時(shí)間:2025/3/15 HTML 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 qt 利用 HTML 生成PDF文档,不能显示jpg图片 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

?

利用 QPrinter 和html 生成 pdf文檔

其中用html語(yǔ)句有顯示圖片的語(yǔ)句

但只能顯示png格式的圖片,不能顯示jpg格式圖片。

經(jīng)過(guò)排查:語(yǔ)法,文件路徑等都正確,最終在stack overflow 中找到 原因:在執(zhí)行程序中沒(méi)有安裝 jpg圖形格式的plugin

https://stackoverflow.com/questions/14878670/qt-does-not-load-jpg-just-png

{

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.

}

?

同樣 在qlistwiget中以圖標(biāo)方式顯示圖片時(shí)也不能顯示jpg格式文件。也用上面的方式解決。

?

轉(zhuǎn)載于:https://www.cnblogs.com/keleman/p/7715849.html

總結(jié)

以上是生活随笔為你收集整理的qt 利用 HTML 生成PDF文档,不能显示jpg图片的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。