diff --git a/TTKModule/TTKNetwork/TTKSocket/tcpclient.h b/TTKModule/TTKNetwork/TTKSocket/tcpclient.h index 772fec1..b20a4c7 100644 --- a/TTKModule/TTKNetwork/TTKSocket/tcpclient.h +++ b/TTKModule/TTKNetwork/TTKSocket/tcpclient.h @@ -46,6 +46,8 @@ private Q_SLOTS: void disConnect(); private: + using QTcpSocket::readData; + int m_clientID; }; diff --git a/TTKModule/TTKNetwork/TTKSocket/tcpserver.cpp b/TTKModule/TTKNetwork/TTKSocket/tcpserver.cpp index a55b643..2b6d32d 100644 --- a/TTKModule/TTKNetwork/TTKSocket/tcpserver.cpp +++ b/TTKModule/TTKNetwork/TTKSocket/tcpserver.cpp @@ -25,8 +25,11 @@ void TcpServer::closeAllClient() client->close(); } } - +#if TTK_QT_VERSION_CHECK(5,0,0) +void TcpServer::incomingConnection(qintptr handle) +#else void TcpServer::incomingConnection(int handle) +#endif { TcpClient *client = new TcpClient(handle, this); client->setSocketDescriptor(handle); diff --git a/TTKModule/TTKNetwork/TTKSocket/tcpserver.h b/TTKModule/TTKNetwork/TTKSocket/tcpserver.h index 94e1141..4011722 100644 --- a/TTKModule/TTKNetwork/TTKSocket/tcpserver.h +++ b/TTKModule/TTKNetwork/TTKSocket/tcpserver.h @@ -40,7 +40,11 @@ private Q_SLOTS: void clientDisConnectChanged(const ClientData &pair); private: - void incomingConnection(int handle); +#if TTK_QT_VERSION_CHECK(5,0,0) + virtual void incomingConnection(qintptr handle) override; +#else + virtual void incomingConnection(int handle) override; +#endif QList m_clientList;