Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
複数のスレッドから呼び出される threadSafe メソッドがあります。どのスレッドがそれを呼び出したかを知る方法はありますか?
メソッドを呼び出すスレッドはわかっているので、そのメソッド呼び出し内で同じスレッドがアクティブになります。これを取得するには、電話するだけQThread::currentThread()です。
QThread::currentThread()
If you need it, you could add a threadId parameter, and let it thread pass it to the method
threadId