How to abort loading a URL in QTWebkit
Qt WebKit
3
Posts
3
Posters
3.4k
Views
1
Watching
-
Dears,
How to abort loading a URL when timeout? For example, if a start load a URL with :
const char *szUrl = "http://www.google.com";
QUrl qUrl = QUrl(szUrl);
m_pWebView->load(qUrl);If there is no response and timeout ,how can I abort this request?
Thanks and Regards,
Juzzy -
AFAIK thats not possible...at least with the QWebView API.
You need a QNetworkReply instance to abort a network transfer. But the API doesn't expose it anywhere.
Thus you you would need to subclass QNetworkAccessManager and reimplement QNAM::createRequest() and do it there. Then set your custom QNAM to the QWebPage.