Question

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

Était-ce utile?

La solution

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

QThread* answer = tmp->thread();
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top