Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to abort loading a URL in QTWebkit
Juzzy last edited by
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);
If there is no response and timeout ,how can I abort this request?
Thanks and Regards,
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.
ThatDude last edited by
//QWebPage::Stop 10 Stop loading the current page.
void QWebView::stop () [slot]
//Convenience slot that stops loading the document.
//It is equivalent to