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
精彩评论