Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. How to abort loading a URL in QTWebkit
Forum Updated to NodeBB v4.3 + New Features

How to abort loading a URL in QTWebkit

Scheduled Pinned Locked Moved Qt WebKit
3 Posts 3 Posters 3.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Juzzy
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      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.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • T Offline
        T Offline
        ThatDude
        wrote on last edited by
        #3

        @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);
        @

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved