QThread* thread = new QThread(); DbWorker* db = new DbWorker(); QObject::connect(thread , SIGNAL(started()), db, SLOT(startProcess())); QObject::connect(db, SIGNAL(finished()), thread , SLOT(quit())); QObject::connect(db, SIGNAL(finished()), db, SLOT(deleteLater())); QObject::connect(thread , SIGNAL(finished()), thread , SLOT(deleteLater())); db->moveToThread(thread); thread->start();
QObject::moveToThread: Current thread (0x2768880) is not the object's thread (0x2768928).Cannot move to target thread (0x42b078)