Qt Network

Qt Network 為使用 TCP/IP 編程應用程序提供瞭一套 API。譬如:請求、Cookie 和通過 HTTP 發送數據的操作,均由各種 C++ 類處理。

使用模塊

使用 Qt 模塊要求直接或透過其它依賴鏈接到模塊庫。一些構建工具為此有貢獻支持,包括 CMake and qmake .

構建采用 CMake

使用 find_package() 命令定位所需模塊組件在 Qt5 包:

find_package(Qt5 COMPONENTS Network REQUIRED)
target_link_libraries(mytarget Qt5::Network)
					

另請參閱 構建采用 CMake 概述。

采用 qmake 構建

添加 network QT 變量:

QT += network
					
					

文章和指南

這些文章包含 Qt Network 設置和具有網絡能力的應用程序的有關信息。

API 參考

這些是 API 參考材料鏈接。

許可和歸屬

Qt Network 在商業許可下是可用的來自 Qt 公司 。此外,它是可用的根據 GNU LGPL (次一般公共許可) 第 3 版 ,或 GNU GPL (一般公共許可) 第 2 版 。見 Qt 許可 進一步瞭解細節。

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 可能導緻 進齣口限定 被應用。