更新代码
This commit is contained in:
@@ -40,12 +40,12 @@ void frmTcpClient::initForm()
|
||||
socket = new QTcpSocket(this);
|
||||
connect(socket, SIGNAL(connected()), this, SLOT(connected()));
|
||||
connect(socket, SIGNAL(disconnected()), this, SLOT(disconnected()));
|
||||
connect(socket, SIGNAL(readyRead()), this, SLOT(readData()));
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
|
||||
connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), this, SLOT(error()));
|
||||
#else
|
||||
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(error()));
|
||||
#endif
|
||||
connect(socket, SIGNAL(readyRead()), this, SLOT(readData()));
|
||||
|
||||
//定时器发送数据
|
||||
timer = new QTimer(this);
|
||||
|
||||
Reference in New Issue
Block a user