PDA

View Full Version : Deployment glitch on other machines



0signal
7th May 2011, 21:09
Hi there.
So my problem is this: I deploy my app (with those 4 dll's included in the release folder) and it works perfectly on my machine. When I run the executable on another system that doesn't have Qt installed it runs without a problem, with one important difference. When I try to open an image file it sees it as null and doesn't add it to my graphics view. This does not happen on my machine. Everything else works well.

The method for adding the image to the graphics view:


void MainWindow::makeImage(QImage image)
{
if (!fileName.isEmpty())
{
pictureScene->clear();
if (image.isNull())//this is where the error occurs, even though I give the image a fileName
{
QMessageBox::information(this, tr("MainWindow"),
tr("Cannot load %1.").arg(fileName));
return;
}
pixmap->convertFromImage(image);
picture = new QGraphicsPixmapItem(*pixmap);
pictureScene->addItem(picture);
}
}


and the slot for opening the image:


void MainWindow::openImage()
{
fileName = QFileDialog::getOpenFileName(this,
tr("Open Image File"), QDir::currentPath());
QImage newImage(fileName);
makeImage(newImage);
}


So this works as it should on my computer, but for some reason it does not on others. Does anyone have any idea what am I doing wrong, cause I'm lost. Thanks in advance.

ChrisW67
7th May 2011, 21:22
Deploy the image plugins for the format(s) you are using, e.g. qjpeg4.dll, into an "imageformats" directory in the same directory as your executable.

0signal
7th May 2011, 21:46
Wow, that was simple. Thanks alot. I'm such newb.