diff options
Diffstat (limited to 'src/webengine')
-rw-r--r-- | src/webengine/webview.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp index 1dca046..686a689 100644 --- a/src/webengine/webview.cpp +++ b/src/webengine/webview.cpp @@ -69,26 +69,24 @@ WebView *WebView::createWindow(QWebEnginePage::WebWindowType type) } // parent Window has been found - WebView *view = new WebView(m_profile, m_parentWindow); + auto index = m_parentWindow->addTab(); + WebView *view = m_parentWindow->view(index); switch(type) { case QWebEnginePage::WebBrowserWindow: // a complete web browser window - m_parentWindow->addTab(view); break; case QWebEnginePage::WebBrowserTab: // a web browser tab - m_parentWindow->swapToTab(m_parentWindow->addTab(view)); + m_parentWindow->swapToTab(index); break; case QWebEnginePage::WebDialog: // a window without decorations - m_parentWindow->addTab(view); break; case QWebEnginePage::WebBrowserBackgroundTab: // a web browser tab, but don't swap to it - m_parentWindow->addTab(view); break; } |