Hello!

I'm a mostly webdeveloper, so my question can be somekind of a beginners.

I'm writing a function which works with QWebView content, some kind of a macro script which makes action on loaded web page.

code is something like that:

Qt Code:
  1. somefunction() {
  2.  
  3. QWebView *webView;
  4. webView->setUrl(QUrl("http://www.google.com"));
  5. <...> here I want to pause the code until the page is loaded <...>
  6. here goes the code of html manipulation, click on another link
  7. <...> here I want to pause the code until the page is loaded <...>
  8.  
  9. }
To copy to clipboard, switch view to plain text mode 
Ok, so in places where I wrote "<...> here I want to pause the code until the page is loaded <...>" I dunno what to do to pause the function and make it wait for page to finish loading. I know about signals and slots. But if I use slot here, I will have to continue in another function - in SLOT function, but I want to leave all the code and logic in somefunction(). How do I do this?