Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Pause for loop until signal receieved
Forum Updated to NodeBB v4.3 + New Features

Pause for loop until signal receieved

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 690 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    El3ctroGh0st
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by VRonin
      #2
      QEventLoop pauseLoop;
      connect(/*sender*/,/*signal*/,&pauseLoop,&QEventLoop::quit);
      pauseLoop.exec();
      

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      E 1 Reply Last reply
      5
      • VRoninV VRonin
        QEventLoop pauseLoop;
        connect(/*sender*/,/*signal*/,&pauseLoop,&QEventLoop::quit);
        pauseLoop.exec();
        
        E Offline
        E Offline
        El3ctroGh0st
        wrote on last edited by
        #3

        @VRonin It works, thanks a lot!!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved