Hi,
I recently deployed a small app that uses a QLabel to display a QPixmap...see the following 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);
}
QString logoFileFullPath("");
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);
}
To copy to clipboard, switch view to plain text mode
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
Bookmarks