C++ (Qt)void Thread::run(){ QTcpSocket socket; socket.connectToHost( ... ); ...}
class TObj : public QThread{public: TObj(){}; ~TObj(){};protected: void run() { TLocalObj obj; connect( &obj, SIGNAL( fromLocalObjSignal() ), this, SLOT( toObjSlot() ), Qt::QueuedConnection ); connect( this, SIGNAL( fromLocalObjSignal() ), &obj, SLOT( toLocalObjSlot() ), Qt::QueuedConnection ); emit threadStarted(); exec(); };signals: void threadStarted();}