编译QDesigner工具时, error : Undefined interface(已解决)

weixin_38051012 2019-09-19 02:26:16
..\formeditor\itemview_propertysheet.h(60): error : Undefined interface 一堆这样的【error : Undefined interface】。google 没找到解决方案
...全文
1384 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_38079044 2019-09-19
  • 打赏
  • 举报
回复
这些东西,可能看manual来得更快 估计你忘了 CONFIG += designer一类的东西
weixin_38080355 2019-09-19
  • 打赏
  • 举报
回复
有一篇类似的文章是这样的:> ///////////// VisInterface.h> class VisInterface> {> public:>     virtual QList<VisFactory*> visualizations()const=0;> };> Q_DECLARE_INTERFACE(VisInterface, "flt.VisInterface")> ///////////// End VisInterface.h>> ///////////// 3DVisPlugin.h> class C3DVisPlugin : public QObject,public VisInterface> {>     Q_OBJECT>     Q_INTERFACES(VisInterface)> public:>     virtual QList<VisFactory*> visualizations()const;> };> ///////////// End 3DVisPlugin.h>> I get the following two warning/errors when I try to moc the files:> MOC VisInterFace.h> VisInterFace.h(0): Warning: No relevant classes found. No output generated.>> MOC 3DVisPlugin.h> 3DVisPlugin.h(12): Error: Undefined interface>> I'd greatly apppreciate any help on fixing/sidestepping this problemYou don't need to run moc on VisInterface.h, but when moc'ing 3DVisPlugin.h you need to make sure to pass the -I option with an include path that makes it possible for moc to find VisInterface.h as you #include it in 3DVisPlugin.h.这个怎么理解啊?要哪个文件找到哪个文件?
weixin_38085383 2019-09-19
  • 打赏
  • 举报
回复
终于解决了 是由于:执行moc的时候的路径找不到。 若使用VS遇此问题,检查:图片:未命名2.jpg(方法:点击出问题的文件<应该是个.h头文件>, 【属性】界面应该如下。如果不是,要在【General】中设置成:Custom Build Tool(如下图))图片:未命名3.jpg在【Custom Build Tool】->【General】->【Command Line】中检查路径吧!(其他的也可以查查)总之,我遇到的问题是出自这里。PS:QtCreator我还是不会用。还是VS用着习惯。

474

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧