Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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