Emitting signals from std::thread
-
I have a class A, (which cannot be modified) that accepts a callback which gets called at certain intervals. In order to update the GUI, I register a lambda which emits a signal as my callback. The callback itself runs on a separate thread (std::thread managed by class A). While I can clearly see that the lambda gets called periodically, the slot attached to the emitted signal never gets invoked. What am I doing wrong?
I do not see any errors in console and the slot/signal hookup is done in GUI thread and I have verified that the connect call successfully connects the signal and slot.
-
Hi,
Can you show the code you use for signal and slots handling ?
-
As it turns out, a user defined enum class was being emitted as signal. This type needs to be registered. The strange thing was no errors in console however. It is working as intended now.