Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Unable to display Qpixmap png images in release mode
sharon_obl82 last edited by
I know some people have asked this question before and I've tried the solutions suggested but they didn't work for me so I'm just gonna try to ask for help again here.
I have images that will be displayed during runtime, they are ok when compiled in debug mode but when build in release mode, the images cannot be seen. I also have /imageformats dir with qmng.dll file in my application folder.
My codes are simple as such:
QPixmap red (":/icons/circle-red.png");
if (//some condition)
The standard questions in this case are: what's your folder structure exactly and which dlls did you copy there? Do you have multiple Qt versions installed and are you sure you didn't mix them? Are you sure you didn't copy dlls from Qt Creator directory instead of Qt directory? Do you have a custom qt.conf file in your app directory? I know you said you've got imageformats dir but many people think they got it right but they don't.
If all these things check out you can use "Dependency Walker":http://www.dependencywalker.com/. Run it in profile mode and trigger the method above. DW will tell you which dll the app tries to load, where it is located and if it's found at all or something is missing.
giesbert last edited by
are you sure that qmng.dll is for png files?
andre last edited by
Weird... PNG does not require plugins; it is built into Qt directly.
One thing you can try to find where it's failing is to open your file with QFile and check what error it returns