I am developing an TCP server application. I have the newDataReceived slot and I emit a signal in it like this:
void myclass::newDataReceived()
{
char data_received[1024] = {0};
client->read(data_received, client->bytesAvailable());
QString msg = data_received;
QString client_ip = client->peerAddress().toString();
emit dataReceived(msg,client_ip);
}
I have catched the signal from MainWindow, there is no problem. But, I have another class which is a QThread and I want this class to catch this signal too. But it does not do it. I connected the signal to my slot like,
srv_thread = new myclass();
connect(srv_thread, SIGNAL(dataReceived(QString,QString)), this, SLOT(incoming_message(QString,QString)));
What am I missing?
Thanks in advance!