[Interest] Odd new-style connect()/disconnect() error with Qt 5.5.0

André Somers andre at familiesomers.nl
Thu Oct 15 09:21:01 CEST 2015


Op 15-10-2015 om 09:11 schreef André Somers:
> I am using this little helper for those cases:
>
> //tricktomakeconnectingwithQt5-styleconnectstooverloadedsignals
> template<typename...Args>structSELECT{
> template<typenameC,typenameR>
> staticconstexprautoOVERLOAD_OF(R(C::*pmf)(Args...))->decltype(pmf){
> returnpmf;
> }
> };
> I found it 
> http://stackoverflow.com/questions/16794695/qt5-overloaded-signals-and-slots
>
> It allows you to connect like this for your case:
>
> connect(stream.data(), 
> SELECT<QAbstractSocket::SocketError>::OVERLOAD_OF<QTcpSocket::error>,
>         this,  &TCPChannel::slot_socket_error);
That should have been


connect(stream.data(), 
SELECT<QAbstractSocket::SocketError>::OVERLOAD_OF(&QTcpSocket::error),
         this,  &TCPChannel::slot_socket_error);

of course.

André

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151015/d254ac4b/attachment.html>


More information about the Interest mailing list