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. Does a loop continue running even if Signals and slot is not complete?

Does a loop continue running even if Signals and slot is not complete?

Scheduled Pinned Locked Moved Solved General and Desktop
21 Posts 5 Posters 3.9k 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.
  • J.HilkJ J.Hilk

    @GCDX
    untested of course.

    MainWindow::MainWindow(...){
        ....
        connect(innerPage, SIGNAL(loadFinished(bool)), SLOT(parse(bool)));
        urlList = QList<QUrl> ({QUrl("Url1"), QUrl("Url"), ...});
    }
    
    void MainWindow::continue(){
         if(cnt < urlList.size()){
             innerPage->setUrl(urlList.at(cnt));      
             print(cnt); 
         } 
    }
    
    void MainWindow::on_pushButton_clicked()
    {
       cnt = 0;
       continue();
    }
    
    void MainWindow::parse(bool)
    {
    QWebFrame *frameInner = innerPage->page()->mainFrame();
    QWebElement doc = frameInner->documentElement();
    QString json=doc.toPlainText();
    //parsing code
    print("parsing executed");
       continue();
    }
    }
    
    6thC6 Offline
    6thC6 Offline
    6thC
    wrote on last edited by
    #21

    @J.Hilk said in Does a loop continue running even if Signals and slot is not complete?:

    connect(innerPage, SIGNAL(loadFinished(bool)), SLOT(parse(bool)));

    well there you go - I mean, I'd have expected that to be just fine in the new syntax but there it is specifying SIGNAL and SLOT too =) - that's new to me.

    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