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 によるネットワークプログラミング- ネットワーク機能を備えたアプリケーションのプログラミング
- Secure Sockets Layer (SSL) クラス- ネットワークソケットを介したセキュアな通信のためのクラス
APIリファレンス
API リファレンス資料へのリンクです。
モジュールの進化
「Qt Network 」には、Qt 6 シリーズにおいてモジュールの API および機能に施された重要な変更点が記載されています。
ライセンスおよび帰属表示
Qt Network は、The Qt Company からの商用ライセンスの下で提供されています。さらに、GNU Lesser General Public License バージョン 3 またはGNU General Public License バージョン 2 の下でも利用可能です。詳細については、「Qt ライセンス」を参照してください。
さらに、Qt 6.12.0に含まれるQt Network には、以下の寛容なライセンスに基づくサードパーティ製モジュールが含まれている場合があります:
Mozilla Public License 2.0 | |
BSD 3条項「New」または「Revised」ライセンス |
Qt Network は、バックエンドとしてOpenSSL ツールキットを利用できます。その場合、ライブラリはOpenSSL ライセンスの遵守を必要とする方法で OpenSSL にリンクされます。GPL に基づいて OpenSSL をQt Network にリンクできるようにするため、GPL に対する以下の例外が適用されます:
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を同梱すると、輸入・輸出規制が適用される可能性がある点にも注意してください。
© 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.