Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Solved WebView not loading after fail first

    Qt WebKit
    2
    10
    2525
    Loading More Posts
    • 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.
    • McLion
      McLion last edited by

      Hi

      I'm using QWebView to display webpages with webGUI->load(QUrl(url));

      This works as expected and loadFinished() returns the status.
      If it returns a fail I'd like to set it to load the page again up to a limited number of retries - this is all done by my surrounding code.

      However, on the second load it never returns, saying loadFinished() is never triggered.
      Is there something else I need to do except issuing the very same load command again?
      I'm using a rather old version that is part of my Qt4.6.3.

      Thanks
      McL

      1 Reply Last reply Reply Quote 0
      • K
        Konstantin Tokarev last edited by

        QtWebKit shipped with 4.6 is really old and may contain lots of bugs fixed since that age, so you should really upgrade

        If you are hard stuck to Qt 4.6 for some reason, you can try building QtWebKit from Qt 4.7 (aka QtWebKit 2.0.0) for your Qt

        McLion 1 Reply Last reply Reply Quote 0
        • McLion
          McLion @Konstantin Tokarev last edited by

          @Konstantin-Tokarev
          Yes, I am stuck to 4.6.3 for this project. This is a dev kit I did not put together myself. It also uses directFB with HW-specific drivers to use the HW available in the SoC it runs on.

          I'd love to update QtWebKit because it has so many issues I always face and stumble over.

          Does the version from 4.7 expose the very same API? I mean, do you know if it is likely to be able to patch the WebKit sources only and it will compile and run?

          McLion K 2 Replies Last reply Reply Quote 0
          • McLion
            McLion @McLion last edited by

            @McLion
            Actually, I just found that I don't have the sources for the current version used.
            There are libQtWebKit.* only.
            So, would I build the later version and replace these lib's, or ...?

            1 Reply Last reply Reply Quote 0
            • K
              Konstantin Tokarev @McLion last edited by

              @McLion said in WebView not loading after fail first:

              Does the version from 4.7 expose the very same API? I mean, do you know if it is likely to be able to patch the WebKit sources only and it will compile and run?

              I suppose it should build unmodified

              McLion 1 Reply Last reply Reply Quote 0
              • McLion
                McLion @Konstantin Tokarev last edited by McLion

                @Konstantin-Tokarev
                I'll think about trying to update to 4.7.x.
                Is 4.7.x the latest that is close to the current 4.6 version where I do have a great chance of it simply running?

                However, in the meantime I need to have an immediate solution as a patch.
                I found that when I issue a new load() using my external (serial, in a separate thread) command, it then always returns correctly with a failed.
                If I catch the first failed in the loadFinished() signal and issue a new load() right from there, this second load() never returns.
                I tried everything and I'm out of ideas. Do you have any idea what could make a difference between issuing the very same load() using the external command or directly from within the loadFinished() - or is that the issue, that loadFinished() needs to end before a new load can be sent to the webView?

                K 1 Reply Last reply Reply Quote 0
                • McLion
                  McLion last edited by

                  I solved it :-)
                  When the new load() is called from within loadFinished() that returned a false, then the webView does not accept the new load() and hangs forever until sometime later a new load() is called.

                  I ended up in emitting a signal that uses a QueuedConnection from within loadFinished() to allow it to finish before the webView gets a new load() .... et voila.

                  btw: I'm still interested in getting inputs to upgrade WebKit with "minimal" changes to the rest of my application.

                  1 Reply Last reply Reply Quote 0
                  • K
                    Konstantin Tokarev @McLion last edited by

                    @McLion said in WebView not loading after fail first:

                    @Konstantin-Tokarev
                    I'll think about trying to update to 4.7.x.
                    Is 4.7.x the latest that is close to the current 4.6 version where I do have a great chance of it simply running?

                    Maybe you can compile QtWebKit 2.1 too, though officially it was released only for Symbian.

                    However, in the meantime I need to have an immediate solution as a patch.
                    I found that when I issue a new load() using my external (serial, in a separate thread) command, it then always returns correctly with a failed.
                    If I catch the first failed in the loadFinished() signal and issue a new load() right from there, this second load() never returns.
                    I tried everything and I'm out of ideas. Do you have any idea what could make a difference between issuing the very same load() using the external command or directly from within the loadFinished() - or is that the issue, that loadFinished() needs to end before a new load can be sent to the webView?

                    No idea, WebKit is a complex piece of software, and you are using extremely obsolete version of it

                    McLion 1 Reply Last reply Reply Quote 0
                    • McLion
                      McLion @Konstantin Tokarev last edited by

                      @Konstantin-Tokarev said in WebView not loading after fail first:

                      No idea, WebKit is a complex piece of software, and you are using extremely obsolete version of it

                      I solved that one. See my post #7 above yours.
                      Thanks anyway.

                      1 Reply Last reply Reply Quote 0
                      • K
                        Konstantin Tokarev last edited by

                        Oh, great, I've missed your reply :)

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post