0

Is it possible to connect more than 1 signal to a slot in a way that the slot gets called only when all the related signals are emitted?

Navjot Singh
  • 626
  • 1
  • 5
  • 16
  • 2
    It's not immediately clear here as to what you are trying to do. We can help you alot easier if you post some sort of example. – jfh Dec 21 '18 at 22:27
  • I have two separate threads running concurrent functions and each emit a signal on completion. In my main thread is a function that I would like to run after the other two functions running in separate threads are finished. This is a very generic concept based question. I can think of hacks around it, just trying to figure out if the framework supports it in an easier way. – Navjot Singh Dec 21 '18 at 23:47
  • 1
    @DjokerS QThread::wait maybe? It sounds like you want the equivalent of a join. Check this out: https://stackoverflow.com/questions/15324017/making-the-main-thread-wait-till-all-other-qthread-finished – jfh Dec 22 '18 at 00:52
  • I was looking to see if there's anything at the framework level. I understand and agree with the counter/tracking slots to handle specific cases, just not the generic one. Thanks for the suggestions! – Navjot Singh Dec 27 '18 at 04:44

1 Answers1

0

you can first emit the all signals to a other slot,then in that slot you receive all the signals and when all signals come you emit the signal to the slot you want eventually.

kuake56
  • 9
  • 2