Pregunta

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();

¿Fue útil?

Solución

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

QThread* answer = tmp->thread();
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top