PyQt4 + WebKit

David Boddie david at boddie.org.uk
Sat May 30 20:32:25 EDT 2009


On Saturday 30 May 2009 17:39, dudekksoft at gmail.com wrote:

> I need to grab clicked links in QWebView. Everything is fine when I
> use linkClicked() signal. LinkDelegationPolicy is set to
> DelegateAllLinks and there is a problem. If some site has Javascript
> my procedure receives QUrl from linkClicked, next calls:
> 
> webView.setUrl(url) #Where "url" is received QUrl
> 
> Certainly this method doesn't work. Site loads again (in most cases
> it's called http://mywwwsite.net/#).

OK, so if I understand correctly, you don't know how to handle these
special links if you use a delegation policy, and you would prefer it
if they were handled by WebKit.

> As I use 
> QWebPage::DelegateExternalLinks it happens the same, because my
> procedure grabs links with Javascript. I don't know how to cope with
> this problem. Maybe it's possible to set own policy in
> QWebPage.LinkDelegationPolicy? Or maybe some other method to grab
> protocol, host(if external or not) when user clicks link in webView?

So, you only want to handle certain links, and pass on to WebKit those which
you can't handle? Is that correct?

David



More information about the Python-list mailing list