带插槽的 QT 界面
我按照本教程制作了界面和插件: http://doc.trolltech.com/4.6/plugins-howto.html 一切正常。
但知道我想将信号连接到插件的插槽。
尝试这样做时出现错误,该接口缺少 Q_OBJECT 宏。当我添加它时,我收到一个错误,现在接口和插件实现了它。 当我从插件中删除它时,插件就损坏了。
所以我的问题是,是否可以声明一个带有插槽的 qt 接口,所有继承该接口的类都实现它?
I made an interface and plugins by following this tutorial:
http://doc.trolltech.com/4.6/plugins-howto.html
and everything is working fine.
But know I would like to connect a Signal to a slot of the plugins.
Trying to do that I get an error, that the interface i lacking the Q_OBJECT Macro. When I Add it I get an error that now the Interface and the Plugin implement it.
When I remove it from the Plugin, the plugin is broken.
So my question is, is it possible to declare a qt interface with a slot all classes inheritating the interface implement it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,你的插件不能从你的插件接口和其他类或 QObject 本身继承 QObject。
No, your plugin cannot inherit QObject both from your plugin interface and from some other class or QObject itself.