标签: c++ multithreading qt qthread
有些QThread * worker已创建QObject *tmp = new QObject()。另一个线程如何识别worker给定的tmp?是否有类似的东西:
QThread * worker
QObject *tmp = new QObject()
worker
tmp
QThread *answer = tmp->getThreadThatCreatedThisObject();
答案 0 :(得分:2)
您可能正在寻找QObject::thread():
QObject::thread()
QThread* answer = tmp->thread();