QThread* thread = new QThread(this);connect(thread , SIGNAL(started()), obj, SLOT(doSomething()));connect(this, SIGNAL(signalFinishedSumProfit()), thread , SLOT(quit()));obj->moveToThread(thread );obj->start();
connect(thread , SIGNAL(started()), obj, SLOT(doSomething2()));connect(this, SIGNAL(signalFinishedSumProfit()), thread , SLOT(quit()));obj->moveToThread(thread );obj->start();
C++ (Qt)QThread* thread = new QThread(this);obj->moveToThread(thread );obj->start();QMetaObject::invokeMethod(obj, "doSomething);
C++ (Qt)connect(obj, SIGNAL(doSomethingFinished()), this , SLOT(onDoSomethingFinished())); void XXX::onDoSomethingFinished() { QMetaObject::invokeMethod(obj, "doSomething2");}
obj->moveToThread(thread);obj->start();invokeMethod(obj, "doSomething");-------------------obj->start();invokeMethod(obj, "doSomething2");
C++ (Qt)obj->start();
connect(obj, SIGNAL(doSomethingFinished()), this , SLOT(onDoSomethingFinished())); void XXX::onDoSomethingFinished() { QMetaObject::invokeMethod(obj, "doSomething2");}
connect(obj, SIGNAL(doSomethingFinished()), obj, SLOT(doSomething2()));
C++ (Qt)QThread* thread = new QThread(this);obj->moveToThread(thread );thread->start();
C++ (Qt)connect(this, SIGNAL(doSomething()), obj, SLOT(doSomething()));connect(this, SIGNAL(doSomething2()), obj, SLOT(doSomething2()));...emit doSomething();...emit doSomething2();