diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-05-28 10:21:30 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-05-28 10:21:30 +0200 |
commit | 49f1351231a71969160b2574603d198af3cf67b3 (patch) | |
tree | 3f74847f218efc8cf166f3f49e663177daefff41 /src/webengine | |
parent | Swap to new tab after creating it (diff) | |
download | smolbote-49f1351231a71969160b2574603d198af3cf67b3.tar.xz |
Remove Window::addTab(WebView *view)
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; } |