PDA

View Full Version : QPixmap fails to load jpg file in spit of that qjepg4.dll is copied



maximin
28th October 2011, 05:59
Dear all,

I ran into a problem that using QPixmap's load()function to load jpg file works fine on my IDE machine but fails on other ones.
As suggested, I copy qjpeg4.dll to the same directory with exe file, still no effect.

Do I have to register the dll(I tried regsvr32.exe to register qjpeg4.dll, but seems it is not needed)? Anything is missing?

Thanks in advance!

ChrisW67
28th October 2011, 06:28
No, you need to put the JPEG plugin in the correct directory. The general layout is:


C:\Program Files\My Funky Program\
- program.exe
- QtCore4.dll
- QtGui4.dll
- ...
+ imageformats\
- qjpeg4.dll
- jgif4.dll
- ...
+ sqldrivers\
- qsqlite4.dll

maximin
28th October 2011, 07:46
Thanks a lot for your prompt reply! Chris. I just tried as you suggest, it works!

But I still get one question at this point - generally programm will load the necessary dll files in system defined directory (or the same directory), why it does not work at this point? Is it Qt's default behavior? Thanks again!