Packaging Qt exe#
Step 1#
How to generate .exe files#
First, change the build mode of the QT Creator editing interface to Release mode and recompile!
Then click Run (ctrl+R)! In the project column, under the build directory, a folder named with "release" will be generated.
It contains the following files:
Open the release folder, which contains the corresponding .exe file!
At this time, clicking on the .exe file will not run successfully because we are still missing the necessary Qt library files.
Step 2#
How to run the generated .exe file on a computer without QT installed#
See below for details: First, place the generated .exe file separately in an empty folder!
Search for Qt in win10 and open the command window in the red box:
Enter the directory where the .exe was just copied
Then enter: windeployqt .exe filename Enter.
At this point, you can see that many files appear in the original empty folder:
At this point, this .exe file can be run on a computer without QT installed!
You need to copy the folder where the .exe file is located to another computer.
You can package this folder and send it to others for testing!
Note: The combination of VS2010 and Qt5.0 plugin can also generate .exe files and can be successfully run on a computer without VS2010 installed.
Step 1#
Change Debug to Release in VS2010, then start debugging (F5), and after successful debugging, the XXX.exe file will be generated in the Release folder under the project folder.
Step 2#
Same as QtCreator software
Step 3#
Same as QtCreator software