久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

使用 Qt 顯示 JPG 圖像不適用于發(fā)布可執(zhí)行文件

Showing JPG image with Qt does not work with release executable(使用 Qt 顯示 JPG 圖像不適用于發(fā)布可執(zhí)行文件)
本文介紹了使用 Qt 顯示 JPG 圖像不適用于發(fā)布可執(zhí)行文件的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問題描述

我在用 qt 顯示 jpg 圖像時(shí)遇到了一個(gè)煩人的問題.我在 Windows 7 中使用 Visual Studio 2008 進(jìn)行開發(fā),并使用 Qt 4.8.2 版.我現(xiàn)在將通過 Qt 提供的collidingmice"示例來(lái)描述我的問題(../examples/graphicsview/collidingmice).

i have a annoying issue with showing jpg images with qt. I devlope with Visual Studio 2008 in Windows 7 and using the Qt version 4.8.2. I will now describe my problem by means of the "collidingmice" example deliverd with Qt (../examples/graphicsview/collidingmice).

我可以通過 Visual Studio IDE 或通過 Visual Studio 命令提示符構(gòu)建此示例.在此示例中,jpg 用作背景,并在我執(zhí)行調(diào)試可執(zhí)行文件時(shí)正確顯示.但在發(fā)布版本中,此背景 jpg 未顯示.

I can build this example via Visual Studio IDE or with via the Visual Studio command prompt. In this example a jpg is used as background and is correctly shown when I execute the debug executable. But in release build this background jpg is not shown.

我已經(jīng)意識(shí)到,Qt 使用插件來(lái)加載/顯示不同的圖像.因此我將Qt的插件文件夾的內(nèi)容復(fù)制到應(yīng)用程序目錄中(collidingmice.exe所在的位置).不幸的是,這并不能解決問題.

I already realized, that Qt uses plugins for loading/showing different images. Therefore I copied the contents of the plugin folder of Qt into the application directory (where collidingmice.exe is). Unfortunatly, this does not solve the problem.

因此,我認(rèn)為 Qt 構(gòu)建和 jpeg 庫(kù)一定有問題.因此,我通過在 Visual Studio 命令提示符下執(zhí)行以下命令重新配置了 Qt:

Hence, I thought there must be something wrong with the Qt build and the jpeg library. Therefore, I reconfigured Qt by executing the following commands in the Visual Studio command prompt:

nmake distclean
configure -debug-and-release -opensource -platform win32-msvc2008 -qt-libjpeg -no-webkit
nmake

之后對(duì)示例進(jìn)行了重建,但再次未顯示 jpg 圖像.我不確定問題是什么,因?yàn)樗谡{(diào)試版本和發(fā)布版本中都有效,我想我只需要提供所需的插件 DLL.但顯然我是不對(duì)的.

After that did a rebuild of the example, but again the jpg image is not shown. I am not sure what the problem is since it works in debug build and in release I think I only have to deliver the needed plugin DLLs. But obviously I am not right.

我希望任何人都可以幫助我,或者可以給我一些可能出現(xiàn)問題的提示.謝謝!

I hope anyone can help me or can give me some hints where the problem might be. Thanks!

推薦答案

所以我把Qt的plugin文件夾的內(nèi)容復(fù)制到了應(yīng)用程序目錄(collidingmice.exe 所在的目錄).

Therefore I copied the contents of the plugin folder of Qt into the application directory (where collidingmice.exe is).

您需要將插件放入imageformats"子目錄,例如喜歡

You need to put the plugins into an "imageformats" subdirectory, e.g. like

bin
 ├── collidingmice.exe
 └── imageformats
       ├── qjpeg4.dll
       ├ ...

另見 http://www.qtcentre.org/threads/46927-圖像格式目錄的位置

原來(lái)OP已經(jīng)相應(yīng)地設(shè)置了目錄結(jié)構(gòu).根本原因是加載了錯(cuò)誤的 QtGui4.dll.這可以通過將 DLL 直接復(fù)制到應(yīng)用程序目錄中或通過更改 PATH 環(huán)境變量中的路徑順序來(lái)解決,以便您的 Qt bin 目錄位于包含 QtGui4.dll 的所有其他路徑的前面.

It turned out that the OP had already set up the directory structure accordingly. The root cause was that a wrong QtGui4.dll has been loaded. This can be fixed "by copying the DLL directly into the application directory or by changing the order of the paths in the PATH environment variable so that your Qt bin directory is placed in front of all other paths containing a QtGui4.dll."

無(wú)論如何,進(jìn)程監(jiān)視器是一個(gè)很好的工具追蹤此類問題.

In any case, the Process Monitor is a good tool to track down such issues.

這篇關(guān)于使用 Qt 顯示 JPG 圖像不適用于發(fā)布可執(zhí)行文件的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How can I read and manipulate CSV file data in C++?(如何在 C++ 中讀取和操作 CSV 文件數(shù)據(jù)?)
In C++ why can#39;t I write a for() loop like this: for( int i = 1, double i2 = 0; (在 C++ 中,為什么我不能像這樣編寫 for() 循環(huán): for( int i = 1, double i2 = 0;)
How does OpenMP handle nested loops?(OpenMP 如何處理嵌套循環(huán)?)
Reusing thread in loop c++(在循環(huán) C++ 中重用線程)
Precise thread sleep needed. Max 1ms error(需要精確的線程睡眠.最大 1ms 誤差)
Is there ever a need for a quot;do {...} while ( )quot; loop?(是否需要“do {...} while ()?環(huán)形?)
主站蜘蛛池模板: 黄网站涩免费蜜桃网站 | av毛片 | 色婷婷综合久久久中字幕精品久久 | 一级做a爰片久久毛片免费看 | 欧美一区二区三区久久精品 | 亚洲精品一区二区 | 国产美女自拍视频 | 久久久久久久久久久久久9999 | 亚洲影视在线 | 欧美国产日韩在线 | 亚洲人成人一区二区在线观看 | 黑人精品欧美一区二区蜜桃 | 久久夜色精品国产 | 亚洲精品久久久久久久久久久 | 国产精久久久久久久妇剪断 | 天天视频成人 | 日日噜噜噜夜夜爽爽狠狠视频97 | 日韩图区 | 精品国产网| 久久99久久 | 国产免费一区二区 | 秋霞在线一区二区 | 久久久久久国产精品 | 国精日本亚洲欧州国产中文久久 | 色婷婷综合网 | 精品一区二区三区在线观看 | 国产在线精品一区二区三区 | 国产不卡一区在线观看 | 免费观看a级毛片在线播放 黄网站免费入口 | 一区二区三区成人 | 亚洲狠狠| 久久成人在线视频 | 亚洲国产精品久久 | 国产精品久久久久无码av | 一级片视频免费 | 最新中文字幕在线 | 国产精品久久国产精品99 gif | 久久久91精品国产一区二区三区 | 国产最新网址 | 亚洲成人av| 久久精品视频免费观看 |