Frage

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

War es hilfreich?

Lösung

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

QThread* answer = tmp->thread();
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top