You will have problems accessing many of the Qt-specific portions of code from one thread for an object that is owned by a different thread. The easiest way around this is to use signals and slots, as suggested by OregonGhost. If that doesn't suffice, you should look at the event code. You could send an event to object A which contains a pointer to object B (that should receive the response), and then in the customEvent()
function of object A, create an event for the response and post it to object B. The cusotmEvent()
function is always run in the thread that owns the given object, so you are safe to interact with the Qt-provided code as much as you want at that point. Posting events to another object is also specifically listed as being thread-safe, no matter the owning thread of the receiving object.