1、安装visual Stusio 15 生成工具2012
2、安装Visual studio Enterprise 2017
3、Visual studio Enterprise 2017安装完成之后,
修改:选择桌面调试,如下:


4、打开QTcreator,选项中,配置编译器:

5、配置完成代码无法调试,需要安装调试器
调试提示:QT 中出现Unable to create a debugging engine
问题及解决:

解决方法:安装Debuggers调试环境。
安装方法:在电脑 控制面板\程序\程序和功能 中找到如下图:

右击选择更改:
next:
勾上Debug个ing Tools for Windows, 点击Change:

等待安装完成即可:


6、配置QtCreator:
1、安装完成之后还需要去Qt中配置一下,如下:
在Qt中选择:Tool(工具) -> Options(选项) -> Kits -> Debuggers,在其中添加刚才安装的WDK路径下的cdb.exe可执行文件:


2、然后在构建套件(Kit)中选择自动匹配到的编译器,我的是VS2017 的MSVC,在调试器中选择刚才添加进来的cdb Debugger,确定即可实现QT Creator的Debugger调试。


7、发布程序
1、运行程序提示: This application failed to start because it could not find or load the Qt platform plugin
2、解决 Qt5 报错
QT为了简化生成发布版本,特别提供了工具 "windeplayqt.exe",这个工具在 "...\Qt5.8.0\5.8\msvc2015_64\bin"的目录下,通过该命令,可以解决上述错误。
打开控制台窗口 设置搜索路径以便系统可以搜索到 "windeployqt.exe" 运行 "windeplayqt.exe D:\work\project\sample\bin\Release\sample.exe", 所需要的QT运行库就自动拷贝到目标程序目录了。
个别程序依赖额库,需要手动拷贝即可。
3、其他:
以上方法也适合debug版本。 如果程序使用了新的QT模块,重新执行一遍即可