On 2015-10-15 03:11, André Somers wrote:
> I am using this little helper for those cases:
>
> //tricktomakeconnectingwithQt5-styleconnectstooverloadedsignals
> template <typename...Args> struct SELECT {
> template <typenameC, typenameR>
> static constexpr auto OVERLOAD_OF(R(C::*pmf)(Args...)) -> decltype(pmf) {
> returnpmf;
> }
> };
My version is less typing :-).
> connect(stream.data(),
> SELECT<QAbstractSocket::SocketError>::OVERLOAD_OF<QTcpSocket::error>,
> this, &TCPChannel::slot_socket_error);
connect(stream.data(),
qtOverload<QAbstractSocket::SocketError>(&QTcpSocket::error),
this, &TCPChannel::slot_socket_error);
(Pedantic: I do believe the '&' is supposed to be unnecessary, although
usually preferred for style reasons.)
--
Matthew
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest