Qt World Summit: Submit your Presentation

When running .exe on another computer, the image cannot be loaded from the resource file

  • I added image to resource file:

        <qresource prefix="/">

    And I change the background (of button,page 1,2 stackwidget,lineEdit,...)in the Design section
    For example :
    Right click on button > change style sheet > background-image: url(:/pic3.jpg);

    I run the code on my PC from the QT creator or .exe and that's right
    I added the required .dlls to run .exe(libgcc_s_dw2-1.dll,libstdc++-6.dll,libwinpthread-1.dll,Qt5Core.dll,Qt5Cored.dll,Qt5Gui.dll,Qt5Guid.dll,Qt5widgets.dll,Qt5widgetsd.dll,platforms Folder)
    But when I run .exe on another computer that doesn't have QT installed, the images don't Load and don't show up
    Where is the problem?
    resource file has .dll that I should add it?

  • Moderators

    hi @zhmh
    you did not run the windeployqt tool, right?

    otherwise you would have a imageformats folder with a qjpeg.dll file in it

Log in to reply