currentThreadId()
is a static member of QThread. It means that
functionClassObj->currentThreadId();
equivalently
QThread::currentThreadId();
which means that you will get the same return value regardless of any object that you use or not use to call the function.
The function in question returns the identifier of the current executable thread, not the proximity of the thread of the object you are trying to call.
If you want to get a reference to the thread object with which the object has an affinity, use QObject::thread()
instead.
source share