[Interest] Not possible to connect QTcpSocket::error signal

Philipp Kursawe phil.kursawe at gmail.com
Fri Nov 22 20:50:29 CET 2013

 the "Qt5-way"?
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2424312414441479834=="

Content-Type: multipart/signed; boundary="nextPart6567963.r7pnNChBp8";
	micalg="pgp-sha1"; protocol="application/pgp-signature"

Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"

Actually that seems to be more a flawed API when the slot and the
accessor have the same name.
From: Thiago Macieira
Sent: 22.11.2013 17:27
To: interest at qt-project.org
Subject: Re: [Interest] Not possible to connect QTcpSocket::error
signal the "Qt5-way"?
On sexta-feira, 22 de novembro de 2013 16:56:47, Ola R=C3=B8er Thorsen wrot=
> Is this a bug in Qt, or did I not use the correct syntax? I recon this ha=
> to do with QAbstractSocket having the error() function as well as an erro=
> signal.

You did not use the correct syntax.

The compiler told you that the problem was that you did not select one of t=
overloads. QTcpSocket::error points to multiple functions and you need to=
select one only.

To do that, you need to cast the identifier to a specific signature.

    void (QAbstractSocket:: *sig)(QAbstractSocket::SocketError) =3D
    connect(tcp_socket, sig, this, &MyClass::tcpSocketError);

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center


Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Interest mailing list
Interest at qt-project.org


More information about the Interest mailing list