PDA

View Full Version : QLabel -> setPixmap doesn't work in release build



asanka424
1st March 2012, 17:30
Hi All,

I am using Qt 4.7.4 with Mingw 4.4. I have a weird problem when setting qlabel to display an image. In debug build, the image shows correctly in the label. But in release build, image doesn't show. But label itself is re-sized according to image. (I resize it with label->resize()) but image doesn't show. What might be the problem?

ui->label->setPixmap(QPixmap("c:/images/image.tif"));
ui->label->resize(ui->label->pixmap()->size());

Thanks.
Asanka

Urthas
2nd March 2012, 02:37
Read this (http://www.qtcentre.org/threads/45104-Image-not-appearing-in-Qlabel-after-compiling)and see if it helps.

asanka424
5th March 2012, 22:31
I am not using relative paths. I use absolute paths. actually label resizes according to the image size but only thing is it is not displayed.

Thanks

ChrisW67
5th March 2012, 23:33
Is the release app running on the same machine as the debug one? Are the release mode TIF image plugins available on that machine?

Post a small, self-contained, compilable example that demonstrates the problem on your machine. Don't forget to attach your TIF file.

wysota
6th March 2012, 00:27
... also test your code with a PNG file.