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 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.
KaiAnd 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