Visual studio2017+qt5.14 installation environment configuration tutorial

1 premise

1.1 Visual studio2017

Is an integrated development IDE: Integrated Development Environment (IDE, Integrated Development Environment) is an application used to provide a program development environment, generally including tools such as a code editor, a compiler, a debugger, and a graphical user interface. Integrated development software service suite with code writing function, analysis function, compilation function and debugging function. All software or software suites (groups) with this feature can be called integrated development environments.

1.2 QT

Qt is a cross-platform C++ graphical user interface application development framework developed by Qt Company in 1991. It can develop GUI programs as well as non-GUI programs, such as console tools and servers. Qt's own editor is called qt creator

1.3 Why use QT+VS co-programming

Qt is divided into two parts: IDE and editor. We use the IDE of qt but not the editor qt creator of qt. Instead, we use VS2017 as the editor. Because qt creator has more bugs, vs2017 supports writing qt and is easier to develop. You can also combine qt with other plugins supported by VS2017 to run

1.4 Install the software version

System: Windows 10 x64 bit
Visual studio: 2017 community edition (Visual studio 2017 community)
Qt: 5.14

2 Software download and installation

2.1 Visual Studio 2017 community installation

Download URL: Click here to download VS2017.
Insert picture description here
You need to log in to your Microsoft account. If you don’t have one, you can register one (
Insert picture description here
simplified Chinese is not required) , and then download the community version.
Insert picture description here
Finally, do not download to the C drive
Insert picture description here
and open it after the download is complete. Click Continue and wait for the download Finish
Insert picture description here
Choose to use the c++ desktop development, install it in the default location and
Insert picture description here
Insert picture description here
wait for the download to complete (you can install qt first in the waiting process). The
Insert picture description here
default is just fine
Insert picture description here

2.2 QT installation

Qt download address: Click here to
download The 2.5g one is a
Insert picture description here
bit big. Wait patiently
Insert picture description here
and open the software after the download is complete. You
Insert picture description here
may need to register a qt account first, and then log in.
Insert picture description here
Insert picture description here
I installed it on the F drive (install it anywhere, just remember). It’s
Insert picture description here
not necessary to select all.
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Wait for the
Insert picture description here
Insert picture description here
installation to complete and you can see the recent A lot more in the installation
Insert picture description here

3 visual studio install qt extension plug-in

Open vs2017,
Insert picture description here
Insert picture description here
Insert picture description here
close vs2017, wait for the installation to complete, and restart. There is
Insert picture description here
Insert picture description here
one more qt vs tools in the title bar.
Insert picture description here
Next, configure the environment variables
Insert picture description here
. The folder is in your installation location
Insert picture description here

Insert picture description here
Insert picture description here
Insert picture description here

4 Configure system environment variables

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

If you want to program with qt creator, use the same method to add mingw73_32 or mingw73_64 to the environment variable

Click OK to close variable settings

5 Write the first program to run hello world

Open vs2017

Insert picture description here
You can change the location of the generated file, or not change it. My project name is FirstDemo
Insert picture description here

Click to confirm. The
Insert picture description here
Insert picture description here
default is good. The
Insert picture description here
main interface is
Insert picture description here
double-clicked to open the ui design interface.
Insert picture description here
You can introduce space by dragging and dropping.
Insert picture description here
Just insert a label plug-in,
Insert picture description here
press ctrl+s to save, close the ui design interface, and run
Insert picture description here
Insert picture description here
helloworld to complete

7 Run the qt program you wrote on other computers

1 Open the Qt console of the local computer and
Insert picture description here
select the one you compiled to open
Insert picture description here
. Enter the location of your compiled exe file here
Insert picture description here
and then enter windeployqt+ program name
Insert picture description here

You will find that there are many more files in your files, and you can run them on other computers.

Guess you like

Origin blog.csdn.net/qq_43475285/article/details/109481092