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 のセットアップと、ネットワーク機能を持つアプリケーションに関する情報が含まれています。

API リファレンス

API リファレンスへのリンクです。

モジュールの進化

Qt Network の変更点には、Qt 6 シリーズの Qt で行われたモジュール API と機能の重要な変更点が記載されています。

ライセンスと帰属

Qt NetworkThe Qt Company の商用ライセンスで入手できます。さらに、GNU Lesser General Public License, version 3 またはGNU General Public License, version 2 の下でも利用可能です。詳細はQt ライセンスを参照してください。

さらに、Qt 6.8.2のQt Network 、以下の寛容なライセンスの下でサードパーティモジュールを含むことができます:

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.