PDA

View Full Version : QPixMap support


PreDeToR_
26th June 2007, 16:02
Hi Guys

I have qt4 installed on my Linux machine... and I have a simple dialog with a list item and a qlabel... The List dialog list tiff images, and then when you select the name, then I use the following code to show the image:

QPixmap mypixmap(tiffname);
QFile myfile(tiffname);

if (!myfile.open(QIODevice::ReadOnly | QIODevice::Text))
{
QMessageBox::warning( this , "FoneWorx PC2Fax", "Cannot find file "+myfile.fileName());
return;
}

if(!mypixmap.isNull())
{
lblPic->setPixmap(mypixmap);
showFile = tiffname;
}
else
{
QMessageBox::information( this, "Information","Failed to load " + tiffname);
}

And this works great....Then I go and compile it on my windows machine and this works great.....

The problem seems to come in when running the exe on another machine, I can access the file, but allways seems to fail to load the image into the qpixmap...

Am i just missing some codec or something on the 3rd machine, or would it seem that the windows compile machine, has something that allows it to show these images without a problem...

Regards
PreDeToR_

wysota
26th June 2007, 16:20
You have to copy the tiff image plugin from your Qt installation to the target machine to "imageformats" subdirectory of the directory where your application binary resides. The plugin is in the plugins/imageformats subdirectory of your Qt installation.

PreDeToR_
27th June 2007, 08:15
Thanks a Mill, That works like a charm!!!!