Question

Qt uses signals and slots normally in a single thread, so calling a signal will call a slot in the same thread signal called. Is it any way to use a signal-slot mechanism to pass a message to qt thread ( so slot will be called later in specified thread's context )?

Was it helpful?

Solution

OTHER TIPS

I think the usual way of dealing with that is to have the signal handler enqueue some other function (using boost::bind or some such functor thing) and then have the target threadqueue run it later.

At least with Qt4 that is no problem at all.YOu just need to set up the connection somewhere that you have variables pointing to both of the threads. (i.e. usually in main())

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top