Important: Please read the Qt Code of Conduct -

Unable to display Qpixmap png images in release mode

  • Hi,
    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:
    void RadioUserWindow::verify_fields()
    QPixmap red (":/icons/circle-red.png");
    if (//some condition)

  • Moderators

    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": 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.

  • Hi,

    are you sure that qmng.dll is for png files?

  • Weird... PNG does not require plugins; it is built into Qt directly.

  • Lifetime Qt Champion


    One thing you can try to find where it's failing is to open your file with QFile and check what error it returns

Log in to reply