使用 Qt DBus 库,我很难注册实现多个接口的对象。
<node>
<interface name="x.I1"> <method name="foo"/> </interface>
<interface name="x.I2"> <method name="bar"/> </interface>
</node>
我使用 C++ 多重继承实现了这两个接口。
class Impl : public x.I1, public x.I2 {
public:
void foo(){}
void bar(){}
};
该工具为每个接口qdbusxml2cpp生成一个,但没有将接口实现器添加到该对象的方法。DBusAdaptorQDBusConnection
我想在 DBus 服务上发布这个对象。
QDBusConnection conn=QDBusConnection::sessionBus();
conn.registerObject("/obj",new DBusAdaptor????(&myObject) );
我是否必须实现自己的适配器才能实现这一目标?