开发者

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. W开发者_StackOverflow社区hat do i do?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜