Qt installation tutorial

Qt is actually a C++ desktop graphics window class library, that is, some libs and dlls. As long as you import these class libraries into your own project, you can call the qt class library to do some operations, such as creating windows.

So you can configure these qt class libraries in vs2019 and use them in clion. The Qt company also provides a Qt plug-in specifically for Visual Studio.

The Visual Studio Qt plug-in is "Visual Studio Add-in 2. 0. 0 for Qt5 MSVC 2015", which can be downloaded and installed from the Qt official website.

However, qt officially provides an integrated development tool, which is qt creator. This integrated development tool is also easier to use


Let's start to introduce the installation process of the Qt environment.

After Qt 5.15, no offline installation package is provided, that is, the 3.7G exe installation package. Please see the official instructions , so you can only use the online installation package.



1. Download the online installation package  QT online installation package link , and then use the following command to start the installation package and switch to the source of the University of Science and Technology of China . Be sure to switch the source, or the download will be very slow.

Tips: The source parameters can only be specified by command line startup, and the parameters cannot be specified by directly clicking exe.

.\qt-unified-windows-x86-4.2.0-online.exe --mirror https://mirrors.ustc.edu.cn/qtproject

2. Specify the qt installation path, I put it in the C drive, as follows:

3. Select the installation components. In this step, you can choose various versions of qt and related supporting software.


Then continue to click next, next, and wait for the installation to complete

Important reminder: After the installation is complete, if you find that some components are missing or unchecked, you can re-check them by executing the following command.

Note that you must use the command line to open it, so that you can switch the source, or if the pull fails, only the installed components will be displayed, and no other components will be checked for you.

C:\Qt\MaintenanceTool.exe --mirror https://mirrors.ustc.edu.cn/qtproject

Let's talk about the relationship between various components of qt.

The components checked in the third step above, Qt 6.1.3, Qt 6.0.4 , Qt 5.15.2 , actually correspond to the qt version in qt creator. Then MinGW 8.1.0 32bit is the compiler. Qt 6.1.3, Qt 6.0.4 I understand these as the version of the Qt framework. The relationship between these components in qt creator is as follows:

In the figure above, the Qt directory has the msvc compiler. vs2019 also has its own msvc compiler. They may have different versions, but both are msvc. Just use their own.


Therefore, the integrated development environment of qt creator supports two compilers, MinGW and MSVC. What is the difference between these two compilers, it is recommended to read the following articles.

1. "Introduction to MSVC Compilation Environment"

2. "Introduction to MinGW"

3. "Advantages of MinGW"


Recommend a free public course of Zero Voice Academy. I personally think the teacher taught it well, so I would like to share it with you: [Linux, Nginx, ZeroMQ, MySQL, Redis, fastdfs, MongoDB, ZK, streaming media, CDN, P2P, K8S, Docker, TCP/ IP, coroutine, DPDK and other technical content, learn now] 

Guess you like

Origin blog.csdn.net/u012117034/article/details/125619848