Hi all,

I've started using the new "Qt5" way of connecting signals and slots, to
get errors compile-time instead of runtime. Great stuff.

Here is one I struggle to connect. If you have a QTcpSocket, and want to
handle the error signal in a slot called tcpSocketError, a connect like
this:

connect(tcp_socket_, &QTcpSocket::error, this, &MyClass::tcpSocketError);


fails, the compiler says

error: no matching function for call to 'MyClass::connect(QTcpSocket*&,
<unresolved overloaded function type>, MyClass* const, void
(MyClass::*)(QAbstractSocket::SocketError))'

All the other signals in QTcpSocket connect fine using the same syntax. So
for now I use the "old" connect for the error signal, and that works fine.

connect(tcp_socket_, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(tcpSocketError(QAbstractSocket::SocketError)));


Is this a bug in Qt, or did I not use the correct syntax? I recon this has
to do with QAbstractSocket having the error() function as well as an error
signal.

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

Reply via email to