The QtNetwork module provides classes to make network programming easier and portable. Qt Network 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.
The Qt Network module offers classes that allow you to write TCP/IP clients and servers. It offers lower-level classes such as QTcpSocket
, QTcpServer
and QUdpSocket
that represent low-level network concepts, and high-level classes such as QNetworkRequest
, QNetworkReply
and QNetworkAccessManager
to perform network operations using common protocols. It also offers classes such as QNetworkConfiguration
, QNetworkConfigurationManager
and QNetworkSession
that implement bearer management.
To use Qt Network classes, add this directive into the C++ files:
#include <QtNetwork>
To link against the module, add this line to your qmake .pro file:
QT += network
The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.