How QT publishes applications and icons

1. Program icon
①Create a file in icon format, and you can convert the common graphic format into an icon file in .ico format online http://www.faviconico.org/

This website can convert png, jpg, and gif files to ico format online. It is very useful for personal testing.
② Put the converted icon file myico.ico into the source code directory, which is the folder where .Pro is located.
③ In the .pro project file Add a line of code: RC_ICONS = myico.ico //Here myico.ico is the name of the icon file
2.
The dynamic link library method used in the official Qt development environment of the release program, when releasing the generated exe program, a large number of dlls need to be copied, If you copy the dll by yourself, it is very likely to lose everything, which will cause the exe to fail to run normally on other computers. Therefore, the official Qt development environment comes with a tool: windeployqt.exe (this file can be found under the bin file in the Qt installation directory).
Take the official Qt 5.4.0+MinGW development environment as an example:
Start Menu -> Qt 5.4.0 ->5.4->MinGW 4.9 (32-bit)->Qt 5.4 for Desktop (MinGW 4.9 32 bit), you can open the Qt command line, and you can execute the windeployqt tool from here.

①Compile the source code into an exe file in Release mode, such as ClockwisePort.exe
②Copy this ClockwisePort.exe to a new separate folder for release, such as in the D:\clock\ folder
③Then from the start menu Open the Qt command line, enter the command: cd /d D:\clock (upper and lowercase, slash, do not make mistakes)
④Then use the windeployqt tool command, continue to enter the command: windeployqt ClockwisePort.exe
⑤Then you can open the D:\clock file In the folder, you can see the plug-in folder, dll file, and qm file automatically copied by the windeployqt tool. At this time, the complete set of exe program releases is obtained, and the dependencies are all resolved.

Guess you like

Origin blog.csdn.net/xipengbozai/article/details/120073354