Qt: Basic Introduction

What is Qt?

Qt is a cross-platform C++ framework (C++ library), which is mainly used to develop Graphical User Interface (GUI) programs, and can also develop command-line (Command User Interface, CUI) programs without an interface.

Qt is cross-platform and supports many operating systems, including computer systems Windows, Linux, Unix, smartphone systems Android, iOS, WinPhone, embedded systems QNX, VxWorks, etc.

Although Qt is the C++ language used, it is not the standard C++ used. Qt has been "extended" to a certain extent. Even so, C++ is still fundamental.

The latest version is Qt5. Qt5 also includes many minor versions, among which Qt5.6 or Qt5.9 is recommended, these two versions are LTS versions (that is, long-term support versions), with fewer bugs and relatively stable.

What Qt can do

Although Qt is often used as a GUI library to develop graphical interface applications, this is not all about Qt; besides drawing beautiful interfaces (including controls, layouts, and interactions), Qt also includes many other functions, such as multi-threading , Accessing databases, image processing, audio and video processing, network communication, file operations, etc., these are all built into Qt.

In 1997, Qt was used to develop the Linux desktop environment KDE, which was a great success, making Qt the de facto standard for developing C++ GUI programs in the Linux environment.

The following programs on the windows operating system are all developed using Qt: WPS, YY Voice, Skype, Douban Radio, Xiami Music, Taobao Assistant, Qianniu, Blizzard’s Battle.net client, VirtualBox, DingTalk, etc.

Linux and embedded Qt are also the main force, widely used in consumer electronics, industrial control, military electronics, telecommunications/network/communication, aerospace, automotive electronics, medical equipment, instrumentation and other related industries.

Although Qt also supports the mobile operating system, it is still not as convenient as the development tools of the mobile platform itself.

Generally speaking, Qt is mainly used for desktop program development and embedded development.

History of Qt

Qt was first developed in 1991 by two Norwegians, Eirik Chambe-Eng and Haavard Nord, who subsequently formally established Trolltech on March 4, 1994. Qt was originally a commercially licensed cross-platform development library. In 2000, Troll Technology released an open source version for the open source community under the GPL (GNU General Public License) license. In 2008, Nokia acquired Trolltech and added the LGPL (GNU Lesser General Public License) licensing model. The Qt commercial licensing business was also sold to the Finnish IT services company Digia in March 2011 because of Nokia's problems. Finally, Digia announced in September 2014 the establishment of a wholly-owned subsidiary of Qt Company to independently operate the Qt commercial licensing business. After more than 20 years of development, Qt has become one of the best cross-platform development frameworks and is widely used in project development in various industries.

GPL and LGPL

GPL authorization: The version software must still be GPL open source software, and the program you write with Qt must be open source

LGPL authorization: (the first L can be called Lesser loose version or Library development library version). Using the Qt official dynamic link library, there is no need to open commercial code. If the dynamic link library is modified, it must be open source.

Comparison between Qt and MFC

Qt has encapsulated the underlying details, is easy to learn, can create a beautiful interface, write once and run everywhere.

MFC can only run on win. This framework just adds a layer of simple packaging to the Windows API. The naming is confusing. If you want to learn, you need a strong winAPI foundation, and it has not been maintained for more than ten years.

Qt development process and tools

Write C++Qt program -> uic generates C++ code file according to .ui file -> moc translates into native c++ code file -> qmake generates corresponding Makefile according to .pro file -> MinGW compiles all code -> generates program

special terms

Makefile : Generate scripts. Although you can directly call compilers such as g++ to compile programs, if there are more code files in the project, which code files are updated and need to be recompiled, which code files have not been changed and do not need to be recompiled, etc., it depends on the program It is more troublesome for the staff to memorize and deal with it. Which codes need to be preprocessed or which library files to link, these are complicated processes. In order to standardize the compilation and generation process of the program, a standardized generation script is produced, which is Makefile. The generator make can automatically generate the target program or library file according to the standardized Makefile. Simply put, it is to define the Makefile so that the programmer only needs to focus on how to write the code, and the dirty work in the process of generating the program is handed over to the make program. Now Makefile is usually automatically generated by tools, such as qmake tool, which greatly reduces the burden on programmers.

Project : The project (or project). The project here refers to a collection of program codes to achieve a relatively independent function. These codes are not just put together, but are related to each other, and have special responsibility Manage the project files of the project. For example, Qt uses .pro files to manage projects, and VC++ uses .vcproj as project files. Integrated development environments usually manage and build projects based on project files (.pro/.vcproj).

Original link

Qt: Basic Introduction-QT Development Chinese Network Qt: Basic Introduction https://qt.0voice.com/?id=933

Guess you like

Origin blog.csdn.net/QtCompany/article/details/130112623