The Qt Network module provides a set of APIs for programming applications that use TCP/IP. Operations such as requests, cookies, and sending data over HTTP are handled by various C++ classes.
Using a Qt module's C++ API requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including CMake and qmake .
使用
find_package()
command to locate the needed module component in the
Qt6
包:
find_package(Qt6 REQUIRED COMPONENTS Network)
target_link_libraries(mytarget PRIVATE Qt6::Network)
更多細節,見 構建采用 CMake 概述。
To configure the module for building with qmake, add the module as a value of the
QT
variable in the project's .pro file:
QT += network
這些文章包含 Qt Network 設置和具有網絡能力的應用程序的有關信息。
這些是 API 參考材料鏈接。
Qt Network 的變化 lists important changes in the module API and functionality that were done for the Qt 6 series of Qt.
Qt Network 在商業許可下是可用的來自 Qt 公司 。此外,它是可用的根據 GNU LGPL (次一般公共許可) 第 3 版 ,或 GNU GPL (一般公共許可) 第 2 版 。見 Qt 許可 進一步瞭解細節。
Furthermore, Qt Network in Qt 6.5.1 may contain third-party modules under the following permissive licenses:
Qt Network can make use of the OpenSSL 工具包 as a back end. The library is then linked against OpenSSL in a way that requires compliance with the 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 可能導緻 進齣口限定 被應用。