I had the same problem sometime ago.
I solved it like this:

Qt Code:
  1. self.connect(self.http, SIGNAL("responseHeaderReceived(const QHttpResponseHeader &)"), self.handleHeaderResponse)
  2.  
  3. [...]
  4.  
  5. def handleHeaderResponse(self, resp):
  6. code = resp.statusCode()
  7. if (code >= 300 and code < 400 and resp.hasKey("location")):
  8. location = QUrl(resp.value("location"))
  9. self.http.setHost(location.host())
  10. self.http.get(location.toString())
To copy to clipboard, switch view to plain text mode 

As you can see it's copied from my PyQt4 application... In C++ it should be something like this (not tested!)

Qt Code:
  1. connect(http, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)), this, SLOT(handleHeaderResponse(const QHttpResponseHeader &)));
  2.  
  3. [...]
  4.  
  5. void MyClass::handleHeaderResponse(const QHttpResponseHeader &resp):
  6. int code = resp.statusCode();
  7. if (code >= 300 and code < 400 and resp.hasKey("location")) {
  8. QUrl location = QUrl(resp.value("location"));
  9. http.setHost(location.host());
  10. http.get(location.toString());
  11. }
To copy to clipboard, switch view to plain text mode 

Hope it helps you!