1. Install devcppbefore installation. I downloaded devcpp-4.9.9.2_setup.exe.
2. Install qt4.4.3 and download QT-
Win-opensource-4.4.3-mingw.rar, unzip the run will ask where your wingw directory is, select the above Dev-CPP installation path.
3,
Draw a window and control in QT designer. Save as. UI document. For example, my window document is named test1.ui and saved in the myproject1 directory.
4,
Compile the document main. cpp that calls the painting window just now. You can use any IDE environment to compile the Standard C ++ code in main. cpp and save it in the myproject1 directory. In
# Incude "ui_test1.h" in the document"
5. Open the command line and go to the myproject1 directory and run the command in qmake-project.
This
Search for the source document under the Directory and generate the Project Document myproject1.pro
6. Run qmake
This is generated according to the myproject1.pro document.
Makefile document
7. Run make
In this case, uic.exe is used to generate ui_test1.h from the test1.ui document.
The window header document called by main. cpp. After that, you can use the CIDR compiler of mingwto compile the document and generate myproject1.exe.
Note: In this case
Run the myproject1.exe program and the window is displayed normally. If you double-click "myproject1.exe" in the resource manager of windows, an error is returned:
Mingwm10.dll is not found, so this program cannot be started. Re-installing the application may fix this problem.
This is because
When qt4.4.3/bin is added to the environment variable, you can modify the path in my computer> Properties> advanced> environment variable to permanently modify the path.
Start running-> Any program-> qt4.4.3 command
Prompt is actually calling qt4.4.3/bin/qtvars. BAT to temporarily configure the environment variables for compilation and running, so it can be directly run in the command line after compilation
Myproject1.exe