MorrisLiang
13th May 2010, 03:59
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.
bool MyApp::validate()
{
QString requestURL = "http://xxxxxx.com/check?username=aaa&password=bbb";
QNetworkReply* reply= manager.get(QNetworkRequest(requestURL));
....
}
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.
Here,I use validate() to check the info.
bool MyApp::validate()
{
QString requestURL = "http://xxxxxx.com/check?username=aaa&password=bbb";
QNetworkReply* reply= manager.get(QNetworkRequest(requestURL));
....
}
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.