InvokeMethod on QTcpSocket
i am trying to invoke "write" on a tcp socket that is in another thread:
QTcpSocket* my_socket_in_other_thread = new QTcpSocket();
QThread* the_thread = new QThread();
but this get me the error:
QMetaObject::invokeMethod: No such method QTcpSocket::write(const QByteArray&)
what am i doing wrong?
Hi and welcome to devnet,
You can't call write like that, it's not a slot nor a Q_INVOKABLE method
so what is the proper way to send data throug a socket thats in an eventloop of QThread?
Do i need to subclass QThread or make a wrappercalss for QTcpSocket?
The worker object paradigm would be appropriate