I used QNetworkAccessManager to handle send a http request:
void f()
{
QNetworkRequest request( QUrl( address ) );
QNetworkAccessManager mng;
mng.get(request);
//QEventLoop().exec();
}
void main()
{
...
f();
...
}
If without line QEventLoop().exec();, the app will not send request. But if with line QEventLoop().exec();, it will. I don't understan why?
Can you clear me?
Thank you very much!
(P/s: I have seen this link: Sending an HTTP request using QNetworkAccessManager)