ubuntu-phone team mailing list archive
-
ubuntu-phone team
-
Mailing list archive
-
Message #18108
Re: Bug in the behavior of onLoadingChanged in WebView
On Fri, Feb 5, 2016 at 6:06 PM, Costales <costales.marcos@xxxxxxxxx> wrote:
> Hi! I filled this bug (I'm not sure if this is from oxide or not,
> please, if you know, reassign. Thanks):
> https://bugs.launchpad.net/oxide/+bug/1542409
>
> This could have a wrong behavior in a few applications (uNav is one of them).
> You can reproduce with this code in the last Ubuntu 16.04 updated to today:
>
> Create test.qml:
> import QtQuick 2.0
> import Ubuntu.Web 0.2
> WebView {
> url: "http://ubuntu.com"
> onLoadingChanged: {
> console.log('loading value: ' + loading);
> }
> }
>
> Run with: qmlscene test.qml
>
> IMHO when the page finished the load, the onLoadingChanged event
> should be triggered, then, 'loading' should be 'false'.
>
> The bug is that 'loading' is always 'true'.
> The problem with this bug is that an aplication (like uNav) can't know
> when the webview complete the load.
>
> Thanks in advance!
The loadindChanged signal has been deprecated for over a year,
unfortunately it wasn’t made explicit (by means of a warning printed
out on console) until very recently.
You want to use the the loadingStateChanged signal instead:
WebView {
onLoadingStateChanged: console.log("loading value:", loading)
}
HTH,
Olivier
Follow ups
References