QPixmap not loading image(from file) after deployment.
Hi,
I recently deployed a small app that uses a QLabel to display a QPixmap...see the following code:
Code:
if(fileFound(logoFileName, logoFileFullPath, fileList))
{
found = true;
imageLoaded = pixmap->load(logoFileFullPath); //fails here
*pixmap
= pixmap
->scaled
(QSize(logoWidth, logoHeight
),Qt
::KeepAspectRatio, Qt
::SmoothTransformation);
label
->setGeometry
(QRect(logoWidth
/2,
30,logoWidth,logoHeight
- 20));
label->setPixmap(*pixmap);
}
It works fine on my machine...but when my co-worker runs the app on another machine(mine and his machines are Windows XP) the jpg doesn't show up....it fails at the load step because imageLoaded is false on his machine after that line. Anybody, know why this would happen? I deployed all the dlls that Dependency Walker listed with the app. The resource is definitely being found by the app(I added code to print some debug info, it found the file but failed to load it.) Thanks for any ideas!
edit: I noticed the jpg I was trying to load has an embedded color profile "Color LCD" in it. I converted it to something to do with RGB. Haven't gotten my coworker to test it yet, but could that have anything to do with it? If so, why would it work on my windows machine and not his?
csmithmaui
Re: QPixmap not loading image(from file) after deployment.
did you properly deploy the jpeg plugin?
I always test deployment inside a vm.
Re: QPixmap not loading image(from file) after deployment.
no I didn't....I wasn't aware that that I needed one. Would I need to deploy it just because I am trying to load a jpeg into a QPixmap?
Thanks for your help!
Re: QPixmap not loading image(from file) after deployment.
Quote:
Originally Posted by
csmithmaui
no I didn't....I wasn't aware that that I needed one. Would I need to deploy it just because I am trying to load a jpeg into a QPixmap?
Thanks for your help!
Yes, according to this you do:
http://doc.qt.nokia.com/4.6/deployme...tml#qt-plugins
Re: QPixmap not loading image(from file) after deployment.
@schnitzel:
Thanks very much, I included qjpeg4.dll in plugins/imageformats under my root, then added a qt.conf setup to use the plugin path. It worked fine. Thanks again!
csmithmaui