emit sendResult(resultCode,resultData); emit finish();
void Thread::startProcessing(quint16 recCode,QString recData){ data=recData; code=recCode; std::cout << "33 "; connect(this,SIGNAL(finish()),SLOT(deleteThread())); start();}void Thread::deleteThread(){ std::cout << "44 "; quit(); wait(); deleteLater();}
QThread *thread = new QThread(this); connect(thread,SIGNAL(finished()),thread,SLOT(deleteLater())); pRecip->moveToThread(thread); thread->start()
Thread *newThread=new Thread(); connect(newThread,SIGNAL(sendResult(quint16,QStringList)),client,SLOT(readResult(quint16,QStringList))); connect(this,SIGNAL(startProcessingThread(quint16,QString)),newThread,SLOT(startProcessing(quint16,QString))); emit startProcessingThread(code,data);
connect(this, SIGNAL(newClient(int)), pRecip, SLOT(newConnection(int))); QThread *thread = new QThread(this); connect(thread,SIGNAL(finished()),thread,SLOT(deleteLater())); pRecip->moveToThread(thread); thread->start();
void Server::incomingConnection(int socketDescriptor){ //qDebug() << socketDescriptor << " Client Connected"; emit newClient(socketDescriptor);}