//方法1 void (QTcpSocket::*onErr)(QAbstractSocket::SocketError) = &QTcpSocket::error; connect(m_tcpClient, onErr, this, &TcpClient::onTcpError); //方法2 connect(m_tcpClient, static_cast<void (QTcpSocket::*)(QAbstractSocket::SocketError)>(&QTcpSocket::error), this, &TcpClient::onTcpError);
//方法3 typedef void (QTcpSocket::*TcpSignal)(QAbstractSocket::SocketError); connect(m_tcpClient, static_cast<TcpSignal>(&QTcpSocket::error), this, &TcpClient::onTcpError);