Qt Network
Qt Network モジュールは、TCP/IPを使用するアプリケーションをプログラミングするためのAPIセットを提供する。リクエスト、クッキー、HTTPでのデータ送信などの操作は、さまざまなC++クラスによって処理されます。
モジュールの使用
Qt モジュールの C++ API を使用するには、モジュールライブラリを直接リンクするか、他の依存関係を介してリンクする必要があります。CMakeや qmakeなど、いくつかのビルドツールはこのための専用サポートを持っています。
CMake でのビルド
find_package()
コマンドを使って、Qt6
パッケージの中から必要なモジュール・コンポーネントを探します:
find_package(Qt6 REQUIRED COMPONENTS Network)
target_link_libraries(mytarget PRIVATE Qt6::Network)
詳細については、CMakeによるビルドの概要を参照してください。
qmakeでのビルド
qmakeでビルドするようにモジュールを設定するには、プロジェクトの.proファイルにQT
変数の値としてモジュールを追加します:
QT += network
記事とガイド
これらの記事には、Qt Network のセットアップと、ネットワーク機能を持つアプリケーションに関する情報が含まれています。
- Qt による Network Programming- ネットワーク機能を持つアプリケーションのプログラミング
- Secure Sockets Layer (SSL) Classes- ネットワークソケットを使った安全な通信のためのクラス
API リファレンス
API リファレンスへのリンクです。
モジュールの進化
Qt Network の変更点には、Qt 6 シリーズの Qt で行われたモジュール API と機能の重要な変更点が記載されています。
ライセンスと帰属
Qt Network はThe Qt Company の商用ライセンスで入手できます。さらに、GNU Lesser General Public License, version 3 またはGNU General Public License, version 2 の下でも利用可能です。詳細はQt ライセンスを参照してください。
さらに、Qt 6.8.2のQt Network 、以下の寛容なライセンスの下でサードパーティモジュールを含むことができます:
The Public Suffix List, version 903a83ff7bfc3148e3692e09396f9f3bdc9462ef, fetched on 2024-06-05 | Mozilla パブリックライセンス 2.0 |
BSD 3条項「新規」または「改訂」ライセンス |
Qt Network は、バックエンドとしてOpenSSL Toolkitを使用することができます。そして、ライブラリはOpenSSLライセンスに準拠することを要求する方法で、OpenSSLに対してリンクされます。GPLのもとでOpenSSLを とリンクすることを許可するために、GPLに対する以下の例外が適用されます:Qt Network
In addition, as a special exception, the copyright holders listed above give permission to link the code of its release of Qt with the OpenSSL project's "OpenSSL" library (or modified versions of the "OpenSSL" library that use the same license as the original version), and distribute the linked executables. You must comply with the GNU General Public License version 2 in all respects for all of the code used other than the "OpenSSL" code. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version of this file.
また、OpenSSLを出荷すると、輸入と輸出の制限が適用される可能性があることにも注意してください。
© 2025 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.