How to abort loading a URL in QTWebkit
-
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. -
@enum QWebPage::WebAction
//QWebPage::Stop 10 Stop loading the current page.void QWebView::stop () [slot]
//Convenience slot that stops loading the document.
//It is equivalent to
view->page()->triggerPageAction(QWebPage::Stop);
@