Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt synchronous QNetworkAccessManager get

What's the proper way to do a synchronous QNetworkAccessManager::get ?

The qt wiki offers an approach, but states "it is not recommended to use this in real applications." The mailinglist offers a similar solution to the wiki.

like image 839
Eugene Avatar asked Aug 06 '12 12:08

Eugene


1 Answers

Yum may use something like this:

QEventLoop loop;
connect(_netReply, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec();
like image 198
Yurij Avatar answered Sep 20 '22 05:09

Yurij