I want to deploy an application to windows using the Qt installer framework. I have some problems setting the icon in the taskbar. I am using
- Qt Creator Version 4.7.2
- qmake
- Desktop Qt 5.11.2 MinGW 32 bit
If I run the application inside Qt Creator the application shows up with an icon in the taskbar.
To deploy it to Windows I do the following steps:
- Build the application as release
- Copy the created .exe inside the data folder of the installer framework
Run the following command to Link everything together:
windeployqt.exe --no-translations --no-quick-import E:\path\to\app.exe
Run the following command to create the installer:
D:\Qt\InstallerFramework\bin\binarycreator.exe --offline-only -c config/config.xml -p packages app_Setup
After that, I get the setupt.exe which I can successfully install on another PC. If I start the application now the icon of the app is missing I only get this standard icon from windows:
So now to what I did:
I have a .qrc file which has the following entry:
<RCC>
<qresource prefix="/">
<file>icon.ico</file>
</qresource>
</RCC>
and an additional .rc file with the following content
IDI_ICON1 ICON DISCARDABLE "icon.ico"
Inside the .pro file I added
RC_FILE = resources.rc
RESOURCES = qresources.qrc
I assigned the icon with Qt Designer as the icon of the main window. Put the following line into the constructor of MainWindow:
setWindowIcon(QIcon("://icon.ico"));
I also checked after running windeployqt if the necessary dlls are in the folder imageformats (I mean the qico.dll)
Still after all of that I don't get any icon inside the taskbar (also it has no icon inside the start menu). The .exe has the right icon.
I searched alot and those are the steps everybody suggested so I don't know why it is not working.
If I start the .exe after creating it with windeployqt the application has a icon inside the taskbar.
After installing it with the created setup the icon is missing. (the qico.dll is present inside the installation folder also)
So I am missing something by creating the setup? Perhabs any of you have a idea.
Thank you!
