Pergunta

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

Foi útil?

Solução

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

QThread* answer = tmp->thread();
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top