QtWebkit: How to check HTTP status code?
问题 I'm writing a thumbnail generator as per an example in the QtWebkit documentation. I would like to avoid screenshots of error pages such as 404 not found or 503 Internal server error . However, the QWebPage::loadFinished() signal is always emitted with ok = true even when the page gives an HTTP error. Is there a way in QtWebkit to check the HTTP status code on a response? 回答1: Turns out you need to monitor the QNetworkAccessManager associated with your QWebPage and wait for a finished(...)