The configuration development environment of QT memoirs

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.