How to configure QT 5.11.1 development environment in Visual Studio 2017 Community

How to configure QT 5.11.1 development environment in Visual Studio 2017 Community

Visual Studio 2017 Community is free for individual developers, and there is no need to crack, save trouble and no longer use pirated versions (laughs)

So how does Visual Studio 2017 Community conduct QT development and how to configure the environment? This article will record my process of configuring the QT development environment.

Tools and system: Visual Studio 2017 Community, Qt5.11.1, win10 Home Edition

1. Download QT

I have already completed the installation of VS2017 Community, so I won t repeat it here.

For Qt, you can go directly to download.qt.io/archive/qt/to download

The version I downloaded is Qt5.11.1


Remember to choose the right version

Next double-click the installer



Just the next step



This step is to log in/register a QT account



Next step



The installation path can be selected or specified by yourself, you need to remember the path of your own installation



Remember not to choose the wrong one



Remember to confirm the following Tools



Then agree to the agreement

2. Configuration of Visual Studio 2017 Community


After the installation is complete, open Visual Studio 2017 Community, click Qt VS Tools> QT Options to configure


Select here

need-to-insert-img

Here choose add to add your own path

need-to-insert-img

Choose your installation path name here, just choose

Then click Tools-Extensions and Updates


As shown

Click online


Click online and enter QT in the input box on the right

Search QT and download and install the plugin



Choose the first download

After completing this step, close Visual Studio 2017 Community to configure system variables

Select this computer right click-Properties-Advanced System Settings-Environment Variables-Configuration Variable Path

Add the path of the folder where QT5Core.dll is located in Path. Otherwise, an error message may appear when you create the Qt project and run it: Cannot find QT5Core.dll



Attributes



Advanced system settings



Environment variable



Double click



Click New and enter the path

The path is generally in the bin directory of msvc2017, please pay attention to choose your own corresponding installation path

After completing this step

3. Create the project

Click File-New-Project



The same operation in English interface

It should be noted here that the project creation of QT may appear in the test of C++ project



Create QT GUI Application



Then enter the qt project to create the default next step here



No special needs can choose the default



Same thing here



Even if the project is created successfully



Here double click on .ui to enter editing

Here you can edit the QT interface (of course the code can also be


Add a label here to be a demo



Double click to edit text

Then remember to save after editing (otherwise an error)


Shortcut keys are more convenient



If this appears in the lower left corner, it means the save is successful

Then click run


Click on



Run successfully

So here, QT 5.11.1 and Visual Studio 2017 Community development environment are successfully configured.

The original article was originally contained in the short book.