Solved New signal slot syntax
-
Hi there,
I have a problem converting this statement:
connect( client, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(onClientError(QAbstractSocket::SocketError)) );
to the new syntax. 'client' is a QTcpSocket.
I tried something like:
connect( client, &QTcpSocket::error, this, &MyServer::onClientError );
but I get an error: no matching member function for call to 'connect'
Can somebody help? Many thanks in advance.
Kai -
Hi,
IIRC, QTcpSocket has two methods named error. You need to use qOverload to select the correct version.
-
And to add to @SGaist, the error() documentation describes how to do it.
-
Hi
Just as a note.
Often docs has sample when qOverload is needed
http://doc.qt.io/qt-5/qabstractsocket.html#error-1 -
Wow, amazing speed and everything 100% correct.
Thanks to all of you!