QT generates executable files (take QT clock as an example)

Steps

Note: The names in the operation process should all be named in English

  1. Switch the QT file to Release mode to compile (the Debug position in the lower left corner can realize the mode switch)
  2. Find the folder generated by Release mode in the directory of the QT project file
  3. Modify the icon of the executable file .exe
    1. Download the icon from the icon website, the format must be .ico format, copy the downloaded icon to the project file (the folder containing main.cpp)
    2. Add in the QT pro file: RC_ICONS=icon file name.exe (the file name must be in English)
    3. Compile, go to the project file to find the icon change
  4. Create a new folder (named in English) on the desktop, save the executable file to be generated, and then copy the .exe executable file in the QT project file to the newly created folder.
  5. For packet, you need to use the QT console to search for QT in the system, and the QT packet function can appear
  6. In the QT console, use the command line: cd / d to create the file path of the new file (do not have a Chinese path), then click Enter to enter the new folder
  7. Continue to use the command line: windeployqt file name.exe (executable file name in the newly created file), and then Enter to generate the configuration.

Insert picture description here
Engineering link

Guess you like

Origin blog.csdn.net/weixin_44333597/article/details/107945896