PDA

View Full Version : Can't display .jpg,.jpeg file in my QT app



Shalabh
19th April 2007, 09:55
Hi all,

I am loading a .jpg file in my QT application and displaying it on paintEvent() of the app.
When i run this app on my machine having QT VS 2003.NET integrated is installed, it works just fine.
But when i run it in a fresh machine Windows XP where QT is not installed, i doesn't show me .jpg file.

Can anybody tell me whats wrong i have done????



Note:
1. I have added QtCore4.dll, QtGui4.dll, and qjpeg1.dll.
2. I tried to use "qjpeg1.dll" by placing it in current app directory and also in "CurrentDir\plugins\imageformats" but this .dll doesn't get loaded by Windows.
3. I also loaded this .dll after user opens a .jpg file. I can see that dll got loaded but nothing happens.


Anyways i suppose that this "qjpeg1.dll" should be loaded automatically when it is required but its not happening in my case.

I know that this dll is the only culprit but i don't know what i have to do.

i also create a qt.conf file in which i wrote:

[Paths]
Prefix = .\

but it doesn't help. :confused:


i got hint to do this from this link.
http://lists.trolltech.com/qt-interest/2006-10/msg00672.html

May be i am not able to understand what has been said.
Can please somebody tell me what i should do to make it work.


Any help would be appreciated. :)
Thanks in advance.

marcel
19th April 2007, 10:15
Where are you loading the image from? From a resource( qrc ), or from an external location (hard drive) ?

wysota
19th April 2007, 11:01
The plugin should be placed in "Currentdir/imageformats" (without "plugins").

Shalabh
23rd April 2007, 15:52
Thnx a lot.....
Putting qjpeg1.dll in below given dir works for me.............
"Currentdir/imageformats" (without "plugins")

Thnx again.......
:)