質問

Some QThread * worker has created QObject *tmp = new QObject(). How can another thread identify the worker given tmp? Is there something like:

QThread *answer = tmp->getThreadThatCreatedThisObject();

役に立ちましたか?

解決

You are probably looking for QObject::thread():

QThread* answer = tmp->thread();
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top