The app I'm creating is relative to the network.I want it to check if the username/password is valid when it starts.And while validating,nothing can the user do.I also want to make the UI responsible.So I think of QEventLoop(I guess that's what I need,right?)

Here,I use validate() to check the info.
Qt Code:
  1. bool MyApp::validate()
  2. {
  3. QString requestURL = "http://xxxxxx.com/check?username=aaa&password=bbb";
  4. QNetworkReply* reply= manager.get(QNetworkRequest(requestURL));
  5. ....
  6. }
To copy to clipboard, switch view to plain text mode 

HOW do I use QEventLoop inside the validate(),so that I can return ture/false,when the server tells me whether the info is correct.