Address QNetworkReply independently, receive a status code from the answer and execute QWebFrame :: setcontent.
QNetworkRequest request(QUrl("http://www.twitter.com")); // 301 to twitter.com connect (frame->page()->networkAccessManager(), SIGNAL(finished(QNetworkReply*), this, SLOT(onFinished(QNetworkReply*)); frame->page()->networkAccessManager()->get(request); [...] void onFinished(QNetworkReply* reply) { if (reply->error() == QNetworkReply::NoError) { int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); switch (statusCode) { case 301: case 302: case 307: qDebug() << "redirected: " << reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl(); break; case 200: frame->setContent(reply->readAll()); break; } } }
source share