在vs中安装完qt插件后,建立QProject进行程序的编写会发现关于qt部分没有代码提示。其中最主要的原因是没有将qt库配置到vs项目中去。
为了简单起见,可以建立一个属性表,以后其他的QProject中可以直接调用。再属性管理器中新建属性表名字任意,具体内容如下
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <ExecutablePath>D:Qt4.8.6in;$(ExecutablePath)</ExecutablePath> </PropertyGroup> <PropertyGroup> <IncludePath> D:Qt4.8.6include; D:Qt4.8.6includeQtCore; D:Qt4.8.6includeQtGui; D:Qt4.8.6QtMultimedia; D:Qt4.8.6QtNetwork; D:Qt4.8.6QtOpenGL; D:Qt4.8.6QtOpenVG; D:Qt4.8.6QtScript; D:Qt4.8.6QtScriptTools; D:Qt4.8.6QtSql; D:Qt4.8.6QtSvg; D:Qt4.8.6QtWebKit; D:Qt4.8.6QtXml; D:Qt4.8.6QtXmlPatterns; D:Qt4.8.6QtDeclarative; D:Qt4.8.6Phonon; D:Qt4.8.6Qt3Support; D:Qt4.8.6QtDesigner; D:Qt4.8.6QtUiTools; D:Qt4.8.6QtHelp; D:Qt4.8.6QtTest; D:Qt4.8.6QAxContainer; D:Qt4.8.6QAxServer; D:Qt4.8.6src; $(IncludePath) </IncludePath> </PropertyGroup> <PropertyGroup> <ReferencePath>D:Qt4.8.6lib;$(ReferencePath)</ReferencePath> </PropertyGroup> <PropertyGroup> <LibraryPath>D:Qt4.8.6lib;$(LibraryPath)</LibraryPath> </PropertyGroup> <PropertyGroup> <SourcePath>D:Qt4.8.6src;$(SourcePath)</SourcePath> </PropertyGroup> </Project>
D:Qt4.8.6
根据自己的实际情况更改D:Qt4.8.6
附:简单方法
在环境变量中新建环境变量QTDIR
变量值为QT路径
D:QtQt5.5.05.5msvc2013
根据实际情况自己更改