Icons disappear on another computer

I created a program with Qt Creator and compiled it in release mode. I added all the necessary DLLs and everything works fine on my computer.

The problem is that when I run the program from another computer, all the icons that I turned on are not displayed, whereas on my computer everything looks fine.

Where could it be from?

Edit: The icons are loaded into the qrc file ...

+3
source share
1 answer

Most support for Qt file formats is dependent on plugins. In order for your application to work as expected when deployed to non-working machines, you will need to make sure that you also deploy the appropriate plugins. If you haven’t done this, downloading files (ICO icons in this case) will simply fail.

In this case, the qico4.dll plugin is important (if you are on Windows).

The official Qt documentation contains all the necessary Qt deployment information for Windows and Mac . Scroll down to the related Qt plugin information.

As a quick fix, you can create a directory called imageformats as a subdirectory of the folder containing your executable file into which you copy the qico4.dll file.

(Note: @smerlin user says that this should be plugins/imageformats relative to your executable directory. It seems that I remember that my applications did not require additional plugins , but I will update the answer if I find that this is true).

+5
source

Source: https://habr.com/ru/post/1435036/


All Articles