下载QT5.10源码,用vs2017 x86Native Tools编译:
1. 新建一个目录并进入,然后执行:
- 源码目录\configure.bat -skip qtwebengine -confirm-license -opensource -debug-and-release -nomake tests -nomake examples -prefix .
2. nmake (我编译了4.5h)
3. nmake install
4. 将生成的以下几个文件,单独放一个目录中

我新建了一个目录:msvc2017_x86,并将这些目录copy放在下面
这样就与QT提供的vs2017 64位版本平级:

6.打开vs,在扩展与跟新中,下载并安装Qt Visual Studio Tools
7.打开Qt Options,并且加入msvc2017_64和msvc2017_x86


8.切换编译版本:(如果解决方案是64位,则不需要切换)
先切换解决方案版本:右击解决方案--->Change Solution's Qt Version--->切换成需要的版本

切换项目版本:右击项目--->Qt Project Settings--->切换成需要的版本

