Did you have a look at the attachment? IMHO it works exactly the same way you want your code to work and it uses requestFinished()

If you want to force "synchronousness", use a busy loop:

Qt Code:
  1. while(!someFlagActive) qApp->processEvents();
To copy to clipboard, switch view to plain text mode 

And make sure the flag is being set when QHttp finishes its job (in a slot connected to done() or requestFinished()).

Your code probably segfaults because requestFinished() is emitted after every http "command" - including QHttp::setHost() so probably "reqId.value(reqId_)" returns an invalid value.