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 ?
Asked
Active
Viewed 334 times
0

Ivy
- 503
- 1
- 10
- 23
1 Answers
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