Does a loop continue running even if Signals and slot is not complete?
Solved
General and Desktop
-
@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(); } }
@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.