本页内容

D-Bus 乒乓示例

演示了一个使用 D-Bus 的简单消息系统。

Ping Pong是一个命令行示例,用于演示 Qt D-Bus。系统会向另一个应用程序发送一条消息,并收到该消息的确认。

运行示例

您可以通过以下方式运行该示例:

运行pong 应用程序,并以该消息作为参数运行ping 应用程序。

$ ./pong &
$ ./ping Hello
Reply was: ping("Hello") got called

示例项目 @ code.qt.io

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.