tags:

views:

54

answers:

1

I have a class which has a method that is called by the main thread and 3 other threads (2 QThreads and 1 made with QtConcurrent::run()). Inside this method I sometimes emit a signal. Is this okay or could it cause problems since I am not emitting signals that belong to the calling threads.

+3  A: 

Yes, this is perfectly ok. QT does the inter-thread communication for you transparently. If the slot that needs to fire is in another thread then the signal gets queued and will be received by the destination thread when it enters its event loop.

You can try it and see what happens in a debugger.

shoosh