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é

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to