Configuration and development environment of Qt memoirs and Development of qt memoirs

Source: Internet
Author: User

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:

Related Article

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.