QT5 信号槽重载
//方法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);
本文来自博客园,作者:一夜梦想,转载请注明原文链接:https://www.cnblogs.com/caiyingyong/p/12620743.html