如何使用 Qtdbus 在系统总线上公开方法
我想使用 Qt Creator 中的 Qt Dbus 在系统总线上公开我的应用程序的方法。 使用会话总线时,方法会被公开,但使用系统总线时,我只能看到我注册的服务名称,但在其下没有公开的方法。(我在 D-feet 中检查它) 我应该怎么办 ?
I want to expose methods of my application on System bus using Qt Dbus in Qt Creator.
while using session bus ,the methods get exposed, but with system bus I am only able to see the Service name with which i registered but no methods to be exposed under it.(I am checking it in D-feet)
What should i do ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须将配置文件(例如:example-dbus.conf)放在
/etc/dbus-1/system.d/
中example-dbus.conf 文件看起来例如:
使用
/etc/init.d/d-bus restart
重新启动 dbus 守护进程,现在应该允许您连接到系统总线。事实上,如果您不允许连接到系统总线,则会显示错误消息。You have to place your config file (e.g: example-dbus.conf) in
/etc/dbus-1/system.d/
The example-dbus.conf file looks like:
Restart the dbus daemon with
/etc/init.d/d-bus restart
and now you should be allowed to connect to the system bus. In fact, if you not allowed to connect to the system bus, a error message will be shown.