将 QtPropertyBrowser 加入到 vs2015 qt版中工程中

我是直接将QtPropertyBrowser的所有文件当子文件夹全部加入到工程里的

加完之后,ok,编译错误

出现一堆以下错误,我只拿出一条

moc_qtbuttonpropertybrowser.cpp(94): error C2027: 使用了未定义类型“QtButtonPropertyBrowserPrivate”

然后google结果

https://stackoverflow.com/questions/28605629/qtcreator-debugger-showing-not-accessible-for-qstring

The problem is your project is set up to compile the generated moc_XXX.cpp files for the qtpropertybrowser headers . In this case they are included at the end of qtXXX.cpp files and are not meant to be compiled separately, as they make use of the private implementation in the ccp. To fix this, in VS, select all the qtXXX.h files from qtpropertybrowser (except for the qtXXX_p.h). Right click and select Properties. In the property page go to Configuration Properties -> Qt Meta-Object-Compiler -> moc and set Dynamic C++ Source to Disable. This will exclude generated moc_ files from direct compilation. They will be compiled as an include in the cpp files from qtpropertybrowser, the way they were meant to be.

  1. 选择来自 qtpropertybrowser 的所有 qtXXX.h 文件(除了 qtXXX_p.h),右键点击并选择 "属性"。

  2. 在属性页中,转到 "配置属性" -> "Qt 元对象编译器 (Meta-Object Compiler)" -> "moc",将 "动态 C++ 源文件" 设置为 "禁用"。这将排除生成的 moc_ 文件直接编译,而是将其作为 qtpropertybrowsercpp 文件中的包含文件编译,这是它们的正确使用方式。

通过执行上述操作,应该能够解决您遇到的错误。如果问题仍然存在,请提供更多的代码和细节,以便我们提供更准确的帮助。

当然了,然后再用他的结果反向百度,是不是我很聪明啊

QtTreePropertyBrowser使用_风烟倦的博客-CSDN博客

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值