Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Regular Contributor
JohnQtQml
Posts: 55
Registered: ‎10-31-2012
My Device: Blackberry 10 Dev Alpha Simulator - VMware

Webview - how to detect if an url is invalid.

Hi, 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?

Please use plain text.
Regular Contributor
JohnQtQml
Posts: 55
Registered: ‎10-31-2012
My Device: Blackberry 10 Dev Alpha Simulator - VMware

Re: Webview - how to detect if an url is invalid.

There is a function for QUrl, called isValid, but this does not work.   My example of "youtube.com" that does not load a website still passes the url().isValid test - eventhough it takes "youtube.com"; to load the page. I guess what I am really asking for is a test to see if the webpage has loaded successfully or not or is able to load successfully. I see there is a QWebView, that has a signal loadFinished(bool ok), where ok tells you if the load is successful, but I am using Blackberry Cascades Webview and QML

Please use plain text.