Qt images don't display in deployed app



  • I deployed an app almost successfully because the images don't show up. Here is what I did:

    created C:\Deployment
    copied the release version of MyApp.exe to C:\Deployment
    copied all the .dll files from C:\Qt\5.2.1\mingw48_32\bin to C:\Deployment
    copied all the folders from C:\Qt\5.2.1\mingw48_32\plugins to C:\Deployment
    

    The program runs fine but missing 2 images one displayed on a label and another on a button.

    I also tried creating C:\Deployment\qml\MyApp folder in which I moved the images following the direction in the link below with no success.

    https://wiki.qt.io/Deploy_an_Application_on_Windows

    The app was created using Qt Designer. After creating the label, I clicked the pixmap and browsed to the image I wanted to use. When I move the mouse pointer over the image icon next to pixmap, it displays the complete path to the image.


  • Lifetime Qt Champion

    Hi,

    I don't remember if it was already available with Qt 5.2.1 but if so you should use windeployqt. That will help ease the deployment process.



  • @SGaist

    Still having the same problem using windeployqt. Here is what I did:

    1. Navigated to the release folder of my app and delete everything except myApp.exe

    2. Clicked : All Programs > Qt > 5.5 > MinGW 4.9.2 (32-bit) > Qt 5.5 for Desktop (MinGW 4.9.2 32 bit)

    3. change directory to the release folder of myApp.exe

    4. Typed : windeployqt.exe .

    Everything ran fine and many files and few folders where created. When I double-clicked myApp.exe, the app started fine but still missing the images.


  • Qt Champions 2016

    @WhatIf said:

    browsed to the image I wanted to use.

    Hi, where is that image located ?
    If you browse to image then the path is stored. so
    after deploy the image must be found in same path.

    It's often much better to include the images in a resource file and point to it there.



  • @mrjj

    Thank you very much :)

    I researched resource file and did the necessary changes and it's now working fine.



  • Please remember to set this as resolved if you are happy with the solution :-)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.