Simpleswitch Direct サーバーおよびクライアント
ミニマルなリモートオブジェクトサーバーおよびクライアント。

directconnectserver および directconnectclient アプリケーションは、より複雑なアプリケーションの開発の出発点として利用できるシンプルなサンプルです。
directconnectserver アプリケーションは、rep ファイルで定義された SimpleSwitch オブジェクトを共有し、directconnectclient アプリケーションはそのレプリカを取得します。 サーバーには 2 秒のタイマーが設定されており、タイムアウトするたびに、SimpleSwitch オブジェクトの boolean 型プロパティ currState の状態が反転し、現在の状態がターミナルに出力されます。 各クライアントは、SimpleSwitch レプリカの状態変更に接続し、現在の状態をサーバーに送信します。サーバーは、接続されたクライアントごとに、そのクライアントの状態をターミナルに出力します。
これら2つのアプリケーションの実装については、例1に記述されています。
その他の簡単な例は、tests/manual/examples/simpleswitch にあります。これら3つのアプリケーションについては、例2および例3で説明されています。
© 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.