|
跟源码看了下,点击链接在浏览器中会重新打开一个页签的网页跳转才会调用void WebContentsDelegateQt::AddNewContents(content::WebContents* source, content::WebContents* new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture, bool* was_blocked)方法,此方法会调用QWebEngineView * WebView::createWindow(QWebEnginePage::WebWindowType type)的方法,Qt5.9.1重载此方法return this可以在已经启动的QWebEngineProccess.exe中加载链接的url,使用5.12.2之后需要打开新页面的链接参考官方的例子重新new一个QWebEngineView,这次时候会再起一个QWebEngineProcess.exe去加载链接的url,此时启动的是两个QWebEngineProcess.exe进程,源码有些看不懂,不知道为什么新版本的Qt为什么不能和之前一样在同一个进程中加载一个点击在浏览器中会重新打开一个页签的链接 |
|