Domanda

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

È stato utile?

Soluzione

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

QThread* answer = tmp->thread();
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top