ikdme
ikdme

Reputation: 37

how do i make links clickable in QtWebView?

I'm in the process of writing a web browser with QtWebView, i tested it using an html page but it turns out the links are not working. What do i do?

Upvotes: -1

Views: 275

Answers (1)

utdemir
utdemir

Reputation: 27216

You should set a "link delegation policy" for WebView's page, because it defaults to "DontDelegateLinks".

Try:

webView.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)

And connect page's link_clicked() signal to appropriate slot.

Look at:

http://doc.qt.nokia.com/4.7-snapshot/qwebview.html#page

http://doc.qt.nokia.com/4.7-snapshot/qwebpage.html#linkDelegationPolicy-prop

http://doc.qt.nokia.com/4.7-snapshot/qwebpage.html#LinkDelegationPolicy-enum

Upvotes: 2

Related Questions