获取创建QObject的QThread

时间:2014-03-27 16:13:48

标签: c++ multithreading qt qthread

有些QThread * worker已创建QObject *tmp = new QObject()。另一个线程如何识别worker给定的tmp?是否有类似的东西:

QThread *answer = tmp->getThreadThatCreatedThisObject();

1 个答案:

答案 0 :(得分:2)

您可能正在寻找QObject::thread()

QThread* answer = tmp->thread();