The easiest way I guess is to Download "qt-opensource-windows-x86-msvc2015-5.6.3.exe" from the Qt official website and install it.
https://download.qt.io/archive/qt/5.6/5.6.3/qt-opensource-windows-x86-winrt-msvc2015-5.6.3.exe.mirrorlist
1- Launch the installer until it is done.
2- Open MSVS 2015.
3- Tools->Extensions and Updates...
4- Click Online. (From the left pane).
5- No in the right pane in the search box enter: Qt.
6- The wizard should find "Qt Visual Studio Tools", "Qt Test Adapter", "Qt Package"...
7- Select QtPackage and click downlaod.
8- After download is done, click install.
9- After install is done close and reopen MSVS 2015. (so that new packages to be added and loaded). Or Click restart Visual Studio.
10- After restart of MSVS you see in the menu "QT5".
11- In the menu Click QT5->QT Options.
12- Click Add.
13- Browse to the folder: C:\Qt\Qt5.6.3\5.6.3\msvc2015
14- Click OK.
15- You don't get an error red message; Which means QT has been successfully detected.
16- You Can add "Qt Visual Studio Tools" the same way as the steps above.
17- Let's create a minimal GUI Application with MSVC2015 using QT5:
1- Open MSVC2015.
2- File->New->Project->Visual C++->Qt->Qt Gui Application.
3- click next. Leave everything as is.
4- click finish.
5- The wizard creates the project.
6- Build and Run. It should work correctly; you get a dialog.
The minimal program generates by the wizard:
#include "QtGuiApplication1.h"
QtGuiApplication1::QtGuiApplication1(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
}
Now if you try to run the application you've just built with MSVC from outside MSVC2015:
1- Open C:\Users(Your User name)\Desktop\QtGuiApplication1\Win32\Debug
2- You'll find the executable there: QtGuiApplication1.exe
3- Double click it.
4- It doesn't work?! Why?
5- Becuase simply you've linked Dynamically to Qt5.
6- So Copy the needed DLLs from Qt installation folder ("C:\Qt\Qt5.6.3\5.6.3\msvc2015\bin") to the same folder as you application.exe (in this case to Debug folder of your application).
7- Double click it now. It should work fine.