Please nominate your Qt Champions for 2021!

.png images don't show when deploy

  • I making a simply GUI with Qt, and have 2 images (splashscreen and a label).
    When I run the program inside Qt it work and the images too.
    But when I deploy the program with "windeployqt" command the images don´t work.
    Code of the spash screen:

    QSplashScreen * splashScreen = new QSplashScreen;
        splashScreen->move((ScreenWidth/2)-(splashScreen->width()/2), (ScreenHeight/2)-(splashScreen->height()/2));

    In the label I choose the file "7Guard7.png" from the resources file in the pixmap proprieties of the label.

    Code of the resources files:

        <qresource prefix="/images">

  • Hi @Samega7Cattac

    The png files are part of the exe file of your program. So, if the png files are not part of the deployed program they were very probably already absent during the build of the release version, before the call to windeployqt.

    What happens when you run the release version "outside of Qt"?


  • @m.sue
    If I try to run the release version outside the Qt it will crash saying:

    This application failed to start because it could not find or load the Qt plataform plugin "windows"
    in "".
    Reinstall the application may fix the problem.

Log in to reply