WebView not loading after fail first



  • 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



  • 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



  • @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
    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 ...?



  • @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



  • @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?



  • 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.



  • @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



  • @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.



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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.