Reputation: 521
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
Reputation: 1
You can connect to the WebView's loadingChanged signal to find out if a page loaded successfully or not.
Upvotes: 0
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