D-Busの複雑なピンポン
Qt D-Bus の型システムの使用例を示します。
「Complex Ping Pong」の例では、 Qt D-BusQDBusVariant およびQDBusReply を用いた型システムの使用方法を示しています。この例は、メインアプリケーションであるcomplexping から、別のアプリケーションであるcomplexpong を起動する構成になっています。hello やping といったキーワードの入力をcomplexpongが処理し、その応答を標準出力に表示します。
例の動作
以下の手順でサンプルを実行できます:
- Qt Creator
Welcome モードを開き、Examples からこの例を選択します。詳細については、Qt Creator の「チュートリアル:ビルドと実行」を参照してください。
- Qt Extension for Visual Studio Code
Command Palette から `Qt: Open Qt examples ` コマンドを実行し、リストからこの例を選択します。詳細については、Qt Extension for Visual Studio Code の「チュートリアル: ビルドと実行」を参照してください。
実行するには、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© 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.