C++ (Qt)connect(MyThread1, SIGNAL(signalThread1()), MyThread2, SLOT(slotThread2()));
Client *pClient;Client::Client(QWidget *parent) : QMainWindow(parent) { pClient = this; ...}
#include "Client.h"extern Client *pClient;void ThreadSocket::run() { ... connect(this, SIGNAL(displayMessage(const QString &)), pClient, SLOT(displayMessage(const QString &))); ... exec();}
Client::Client(QWidget *parent) : QMainWindow(parent) { ... threadSocket = new ThreadSocket(); connect(threadSocket, SIGNAL(displayMessage(const QString &)), this, SLOT(displayMessage(const QString &))); connect(this, SIGNAL(clientSignal()), threadSocket, SLOT(slotSocket())); ... threadSocket_1 = new ThreadSocket(); connect(threadSocket_1, SIGNAL(displayMessage(const QString &)), this, SLOT(displayMessage(const QString &))); ... connect(threadSocket, SIGNAL(signalSocket()), threadSocket_1, SLOT(slotSocket_1)); ...}