Question

I'm got this project where i'm showing images with a qt5 interface, i'm simply setting the Pixmap of a label with the qimage pixmap

The thing is, it's working on a debug build, but not on a release build and i dont understand why.

I already got a folder in my .Exe folder named "plugins" and a subfolder in it named "imageformats", and in this folder the file named "qjpeg.dll"

So i coming here to see if someone has an idea on why it doesn't work ?

Thanks in advance !

Was it helpful?

Solution

I'm assuming that you developed your app in Qt Creator, and that you're not using a .qrc file.

This is the folder structure that Qt expects (left side if you launch your app from Qt Creator, right side if you launch your app by double-clicking its icon):

[Dev]\pic.jpg                        =>  [App]\pic.jpg
[Dev]\release\app.exe                =>  [App]\app.exe
[Qt]\bin\*.dll                       =>  [App]\*.dll
[Qt]\plugins\platforms\qwindows.dll  =>  [App]\platforms\qwindows.dll
[Qt]\plugins\imageformats\qjpeg.dll  =>  [App]\imageformats\qjpeg.dll
---------------------------------------------------------------------
    [Qt]  = Folder where you installed Qt
    [Dev] = Folder where you built your app
    [App] = Folder where you want to deploy your app

Two common mistakes:

  • If you launch from Qt Creator, make sure your picture file is in [Dev] (different folders are used for Debug and Release mode)
  • If you launch by double-clicking, get rid of the "plugins" folder
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top