Qt synchronous QNetworkAccessManager get

Eugene picture Eugene · Aug 6, 2012 · Viewed 9.8k times · Source

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.

Answer

yttrium picture yttrium · Jul 1, 2013

Yum may use something like this:

QEventLoop loop;
connect(_netReply, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec();