QWebView showing only one web page



  • I have a problem, a need to show only one webpage and user cant go to other links, is it possible?



  • Hi,

    I think that it is possible. I do not know exactly which way is the best, but you can try following

    reimplement QWebPage::mousePressEvent(QMouseEvent*) and check what element was clicked by the user. In case of hyper link you can ignore event in other case pass it to QWebView

    set link delegation policy of QWebPage to DelegateAllLinks and then react on linkClicked() signal. Probably during handling of this signal you could stop loading of new page.

    BR,


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.