PDA

View Full Version : QPixmap::save() doesn't work



Persoontje
22nd November 2009, 11:20
Hi,

I'm trying to save a QPixmap using the following code:


void MainWindow::fileExport()
{
QString file = QFileDialog::getSaveFileName(this, tr("Export as"), tr("."), tr("Images (*.jpg);;Images (*.tiff)"));
QMessageBox::information(this, "Export", file);
displayPixmap.save(file,0,100);
QMessageBox::information(this, "Finished", "Finished exporting");
}


(the QMessageBox::information are just for debugging ;) )

On my own computer (Vista) it works, in debug and in release mode. But when I try it on a computer of a friend of mine (also Vista), it doens't. It does display the file dialog, the message box with the filename and the finished message box, however it doesn't save the file.

Does anybody have an idea how to fix this?

faldzip
22nd November 2009, 13:21
probably your application can't handle with jpegs and tiffs because of lacking image formats plugins. Try to copy imageformats directory from QT_DIR\plugins into directory where your friend has your exe file. With Dependency Walker you can check if those plugins (in your case qtiff4.dll and qjpeg4.dll) require any other dlls or something.

Persoontje
25th November 2009, 11:53
Thanks, that did the trick. It's working now ;)