Reputation: 2393
My Qt application contains a Main Window. I added resource into project and added an icon to the resource. From the main window source file I used the following line to load the icon to the main window.
this->setWindowIcon(QIcon("://img/Icon.ico"));
When I run the application from Qt creator, it shows the icon in the mainwindow BUT when I run the exe from the executable path directly(copied all Qt dependency dlls into that folder) it is not showing the icon in the main window.
Not sure what I am missing.
Upvotes: 1
Views: 2007
Reputation: 18524
Put qico.dll
in the imageformats
directore near executable.
MyAppDir\YourApp.exe
MyAppDir\imageformats\qico.dll
On future, every format except of png
should have dll. For example qgif.dll
and so on.
Upvotes: 2