Pause for loop until signal receieved



  • Hello,

    I have the following piece of code:

        for(int i = 0; i < entries.size(); ++i)
        {
            addSource(QUrl(entries.at(i).second), entries.at(i).first);
            //WAIT UNTIL SIGNAL RECEIVED
        }
    

    Basically, what I want to achieve is that the for loops "pauses" until it receives a specific signal. Is there a way to implement this?



  • QEventLoop pauseLoop;
    connect(/*sender*/,/*signal*/,&pauseLoop,&QEventLoop::quit);
    pauseLoop.exec();
    


  • @VRonin It works, thanks a lot!!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.