0

I am trying to implement a simple browser myself using QT, but I got one question now, I wanna to open a new window after clicking a link on a web page, how to realize this function ? How to make QWebView::createWindow() work together with QWebSetting:JavascriptCanOpenWindows ? I know I should use js to realize "open new window", but how to let the browser capture this ?

Ivy
  • 503
  • 1
  • 10
  • 23

1 Answers1

0

You can try to connect QWebView's signal linkClicked with a slot which opens new window.

For example:

connect(ui->webView, SIGNAL(linkClicked(QUrl)), SLOT(openNewWindow(QUrl)));
ariwez
  • 1,309
  • 17
  • 20