QPixmap::save() doesn't work
Hi,
I'm trying to save a QPixmap using the following code:
Code:
void MainWindow::fileExport()
{
QString file = QFileDialog::getSaveFileName(this, tr
("Export as"), tr
("."), tr
("Images (*.jpg);;Images (*.tiff)"));
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?
Re: QPixmap::save() doesn't work
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.
Re: QPixmap::save() doesn't work
Thanks, that did the trick. It's working now ;)