Problems using QPixmap’s loadFromData to load an image
Trying to use the loadFromData to load an image that’s in a sub-folder where the code looks like this:
- QPixmap qp;
- qp.loadFromData(qs.toAscii());
I have the folder both in the project’s folder as well as in the debug folder where the debug .exe is (not sure where I’m supposed to have it) and this function always returns false.
Any help would be much appreciated, thanks.
8 replies
You may use QDir::absoluteFilePath [qt-project.org] to check where the file should be.
Hello
Maybe I miss something, but loadFromData method is used, when you have your picture loaded into memory. Try to use QPixmap::load [qt-project.org] method
You must log in to post a reply. Not a member yet? Register here!



