更新代码
This commit is contained in:
@@ -80,7 +80,7 @@ TcpServer1::TcpServer1(QObject *parent) : QTcpServer(parent)
|
||||
{
|
||||
}
|
||||
|
||||
#if (QT_VERSION > QT_VERSION_CHECK(5,0,0))
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
|
||||
void TcpServer1::incomingConnection(qintptr handle)
|
||||
#else
|
||||
void TcpServer1::incomingConnection(int handle)
|
||||
@@ -120,7 +120,7 @@ void TcpServer1::disconnected()
|
||||
|
||||
bool TcpServer1::start()
|
||||
{
|
||||
#if (QT_VERSION > QT_VERSION_CHECK(5,0,0))
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
|
||||
bool ok = listen(QHostAddress::AnyIPv4, AppConfig::ListenPort1);
|
||||
#else
|
||||
bool ok = listen(QHostAddress::Any, AppConfig::ListenPort1);
|
||||
|
||||
@@ -45,7 +45,7 @@ private:
|
||||
QList<TcpClient1 *> clients;
|
||||
|
||||
protected:
|
||||
#if (QT_VERSION > QT_VERSION_CHECK(5,0,0))
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
|
||||
void incomingConnection(qintptr handle);
|
||||
#else
|
||||
void incomingConnection(int handle);
|
||||
|
||||
@@ -80,7 +80,7 @@ TcpServer2::TcpServer2(QObject *parent) : QTcpServer(parent)
|
||||
{
|
||||
}
|
||||
|
||||
#if (QT_VERSION > QT_VERSION_CHECK(5,0,0))
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
|
||||
void TcpServer2::incomingConnection(qintptr handle)
|
||||
#else
|
||||
void TcpServer2::incomingConnection(int handle)
|
||||
@@ -120,7 +120,7 @@ void TcpServer2::disconnected()
|
||||
|
||||
bool TcpServer2::start()
|
||||
{
|
||||
#if (QT_VERSION > QT_VERSION_CHECK(5,0,0))
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
|
||||
bool ok = listen(QHostAddress::AnyIPv4, AppConfig::ListenPort2);
|
||||
#else
|
||||
bool ok = listen(QHostAddress::Any, AppConfig::ListenPort2);
|
||||
|
||||
@@ -45,7 +45,7 @@ private:
|
||||
QList<TcpClient2 *> clients;
|
||||
|
||||
protected:
|
||||
#if (QT_VERSION > QT_VERSION_CHECK(5,0,0))
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
|
||||
void incomingConnection(qintptr handle);
|
||||
#else
|
||||
void incomingConnection(int handle);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <QtGui>
|
||||
#include <QtNetwork>
|
||||
|
||||
#if (QT_VERSION > QT_VERSION_CHECK(5,0,0))
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
|
||||
#include <QtWidgets>
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user