I can't get QPixmap::save to work outside of my development environment. I build it in release with qtcreator run it with the dll's it needs (qtcore and qtgui). I will get "save successful" in my environment and then the screenshot saved in filepath. The application runs in others but I get "save failed". It writes a 0kb jpeg, but no data. I've tried it on multiple computers and the directory is writable. Any ideas?
|
Source code
|
1
2
3
4
5
6
7
8
|
QPixmap image = QPixmap::grabWindow(QApplication::desktop()->winId());
if ( image.isNull() )
w.SetLabel("image returned null");
else if ( image.save(filepath,format.toAscii()) )
w.SetLabel("save successful");
else {
w.SetLabel("save failed");
}
|