Qt World Summit: Register Today!


wait for slot to finished



  • in my function i'm constantly emit a signal, but i would like to only emit the signal after my slot function are finished, anyway to do that?


  • Moderators

    if (canEmit) {
      canEmit = false;
      emit mySignal();
    }
    // Slot:
    void mySlot() {
      doSomething();
      emit processingFinished();
    }
    // The previous class, slot:
    void onProcessingFinished() {
      canEmit = true;
    }
    

Log in to reply