Configuration and development environment of Qt memoirs and Development of qt memoirs
It has been more than a year of development with Qt. The most common GUI development in Windows is MFC, WinForm, WPF, and Qt. MFC and Qt are based on C ++, while WinForm and WPF are generally based on C #. Of course, the AWT and Swing interface development based on Java on PC are quite common. The message mechanism of MFC is too bloated and complicated to use. Although it was brilliant 10 years ago, it has been gradually replaced by Qt and WPF. The Qt and WPF pages correspond to xml files, and each control can be seen as an object directly. While WPF uses C #, which is currently only supported on Windows, and Qt can be used across platforms. Basically, it supports application development on most mainstream systems.
For the Qt development environment, there are two types: one is to use the VS + Qt class library for development, and the other is to use the Qt Creator + VC compiler for development. The blogger uses the Qt Creator + VC compiler.
Step 1 Download Software
Check that VS has been downloaded and installed on the PC. We recommend that you use VS2012 or a later version.
Qt Official Website: http://www.qt.io/download-open-source/ according to VS version selection suitable for their own Qt version, for example, due to the difference between Qt5 and Qt4, the current general Qt5.0 or above version
Download and install it directly.
Step 2 configure the Compiler
Open the Qt Creator, tool-> Option page, and configure as follows:
Step 3: create the first Qt Program
File-> create a file or project, and select the following:
Enter the project name "Hello". After the project is created, it is as follows:
The entire project contains five default files: Hello. pro, mainwindow. h, main. cpp, mainwindow. cpp, mainwindow. ui
The Hello. pro file is used to describe the entire project resource, including the. h/. cpp/. ui file and the resources in the Qt class library applied in the project. After changing the content in this file, you need to re-Execute clean-> execute qmake-> bulid and then run.
Main. cpp program entry main Function
Mainwindow. ui interface Layout
Mainwindow. cpp/mainwindow. h interface logic
No layout or control is added, and only one main window is available. The running result is as follows: