QT TCP communication

Reprinted: https: //www.cnblogs.com/wurenzhong/p/8018862.html

 

During that client code has to run through a few things to explain :( Under the current version of Qt 5.7.1)

1. .pro project file added:

  QT       +=  network

2. Join the header file:

#include <QTcpSocket>

#include <QDataStream> QT_BEGIN_NAMESPACE class QComboBox; class QLabel; class QLineEdit; class QPushButton; class QTcpSocket; class QNetworkSession; QT_END_NAMESPACE above with reference to the whole of the Qt example, why this whole, not yet know why? Namespace is not the role of different classes to avoid naming conflicts do? 










 

Guess you like

Origin www.cnblogs.com/ProtocolYue/p/11440632.html