[Interest] Not possible to connect QTcpSocket::error signal the "Qt5-way"?

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Fri Nov 22 17:09:40 CET 2013


Il 22/11/2013 16:56, Ola Røer Thorsen ha scritto:
>
> fails, the compiler says
>
> error: no matching function for call to 'MyClass::connect(QTcpSocket*&,
> <unresolved overloaded function type>, MyClass* const, void
> (MyClass::*)(QAbstractSocket::SocketError))'
>

This is a C++ problem -- <unresolved overloaded function type> means 
that error() has overloads, and you need to select the right one:

> connect(socket,
>         static_cast<void (QTcpSocket::*)(QAbstractSocket::SocketError)>(&QTcpSocket::error),
>         this,
>         &Class::method);

HTH,

-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel. UK +44-1738-450410, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4048 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131122/3bf4c6fc/attachment.bin>


More information about the Interest mailing list