在vs中使用qt

1.qt使用mfc

#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS      // some CString constructors will be explicit

// turns off MFC's hiding of some common and often safely ignored warning messages
#define _AFX_ALL_WARNINGS

#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions


#include <afxdisp.h>        // MFC Automation classes



#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h>           // MFC support for Internet Explorer 4 Common Controls
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>             // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT

#include <afxcontrolbars.h>     // MFC support for ribbons and control bars
#include <afx.h>

将上述代码拷贝到qt程序的.h文件中
同时项目属性->配置属性->常规->用mfc设置为Use MFC in a Shared DLL;

2.vs中qt去掉红线提示

https://blog.csdn.net/friendbkf/article/details/49641415
初次用VS进行Qt开发时,会遇到IDE提示找不到对应头文件的红线语法错误。但是编译运行一切正常。
这是因为编译环境include了正确的位置,但是IDE的语法检查器却没有包含对应的位置。
只需修改一下工程属性即可。
项目 - 属性 -VC++目录 - 包含目录,添加Qt的include文件夹路径之后,一切恢复正常,IDE的红线提示消失。
项目 - 属性 -VC++目录 - 包含目录

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值