Install Qt in Windows:
In Windows, install mingw first, and then install QT. The installation process is relatively simple and can be done as prompted ..
Note: During the QT installation process, you will be prompted to select the mingw installation directory, and will be prompted to automatically set the environment variables (automatically set by default)
-----------------------------------------------------
In QT, the first program runs:
1. Copy the following program to the file "Hello. cpp:
# Include <qapplication> # Include <qlabel> Int main (INT argc, char * argv []) { Qapplication app (argc, argv ); Qlabel * label = new qlabel ("Hello QT! "); Label-> show (); Return app.exe C (); } |
2. Save the file "Hello. cpp" in the directory "D:/QT/test/1/Hello" (select the directory based on the actual situation)
3. Select "QT 4.1.4 Command Prompt, enter the command line interface, and enter the directory that just saved "Hello. cpp" (mainly use the doc command: cd d:/QT/test/Hello)
4. At the end of the command prompt, enter:
Qmake-Project
(To create a platform-independent project file (Hello. Pro))
Qmake hello. Pro
(To create a platform-specific makefile from the project file)
Make
(To build the Program)
5. After the preceding three steps, you can obtain the following files in the directory where "Hello. cpp" is located:
6. In this directory, click the "release‑folder" to display the executable program "hello.exe" under Windows ":