Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
I get an error when refactoring connect.
w.tkm last edited by
I refactoring [connect]. Then, I get an error.
connect(m_pUdpSockRecv, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(fnSocketError()));
connect(m_pUdpSockRecv, &QAbstractSocket::error, this, &Udp::fnSocketError);
error: no matching member function for call to 'connect'
Do I need to add anything?
@w-tkm what version of Qt do you use ?
the error signal was deprecated and errorOccured was introduced.
This was made due to the fact that error is not only a signal but also a regular function of QAbstractSocket.
to use an overload in the new connect syntax requires the use of complicated casting, or the use of the qOverload macro