Time flies, has been developed with QT for more than a year. The most common thing to develop a GUI on Windows is MFC,WINFORM,WPF and Qt. MFC and QT are based on C + +, while WinForm and WPF are generally based on C #, and of course the Java-based AWT and swing interface Development on the PC is generally a little bit of a chicken, temporarily not considered. MFC's message mechanism is too bloated, used quite complex, although 10 years ago, but also brilliant, but has gradually been replaced by Qt and WPF. Both Qt and WPF pages correspond to XML files, and each control can be considered directly as an object. While the WPF adoption of C # is currently supported only on Windows, QT can cross-platform and basically support the development of applications on most mainstream systems today.
For the QT development environment, there are generally two, one is to use the VS+QT class library to develop, one is to use the QT CREATOR+VC compiler to develop. Bloggers are using the QT CREATOR+VC compiler.
First step download software
First confirm that the PC has been downloaded VS and installed, recommended VS2012 and above version
QT Official website: http://www.qt.io/download-open-source/According to the version of VS, choose the QT version that suits you, for example, because Qt5 and QT4 are different, now generally use Qt5.0 above version
Install directly after download.
Second step to configure the compiler
Open the QT Creator, Tools--Options page, configured as follows:
Step three, create your first QT program.
To create a new file or project, select the following:
Enter the project name Hello, after creating the project as follows:
The entire project contains the default 5 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 files, and the resources in the Qt class library that are applied in the project. Each time you change the contents of this file, you need to re-execute clean-> to execute qmake->bulid before running.
Main.cpp Program Entry main function
Mainwindow.ui Interface Layout
Mainwindow.cpp/mainwindow.h interface Logic
No layouts and controls are added, only one main window. The results of the operation are as follows:
The configuration development environment of QT memoirs