Nesta página

Ping-pong complexo do D-Bus

Demonstra o uso do sistema de tipos do Qt D-Bus.

O exemplo “Ping Pong complexo” demonstra o uso do Qt D-Bus sistema de tipos com ` QDBusVariant ` e ` QDBusReply`. O exemplo consiste no aplicativo principal ` complexping `, que inicia o outro aplicativo, ` complexpong`. A inserção de palavras-chave como ` hello ` e ` ping ` é processada pelo `complexpong`, e a resposta é exibida na saída padrão.

Executando o exemplo

Você pode executar o exemplo a partir de:

Para executar, inicie o aplicativo complexping.

$ ./complexping
Ask your question: When is the next Qt release?
Reply was: Sorry, I don't know the answer
Ask your question: What is the answer to life, the universe and everything?
Reply was: 42

Projeto de exemplo em 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.