user1296259
user1296259

Reputation: 521

Webview - how to detect if an url is invalid in Blackberry Cascades

I am trying to find a way to detect whether an url is an invalid url for a webview

For example, if I do

myWebView->setUrl(QUrl("http://www.youtube.com")); //then the webview will change to that page, but if I do...

myWebView->setUrl(QUrl("youtube.com")); //it will not change, because it considers it an invalid url.

Is there some kind of signal, or some sort of property that I can use to detect that?

Upvotes: 0

Views: 406

Answers (2)

D H
D H

Reputation: 1

You can connect to the WebView's loadingChanged signal to find out if a page loaded successfully or not.

Upvotes: 0

user1957754
user1957754

Reputation: 11

Yes you have solution for this:

You can use inbuilt function isValid();

For eg :

myWwebView->url().isValid(); //It will return true or false value.

For more help refer following link

Upvotes: 1

Related Questions