ui: Fix new tabs always showing the welcome page (fixes #851)

This commit is contained in:
Oleg Shparber
2018-01-06 15:47:26 +02:00
parent a406f8de5f
commit d0cdc200bb
4 changed files with 9 additions and 5 deletions
+3 -3
View File
@@ -23,6 +23,7 @@
#include "webview.h"
#include "webviewtab.h"
#include "../mainwindow.h"
#include <core/application.h>
@@ -94,9 +95,8 @@ QWebView *WebView::createWindow(QWebPage::WebWindowType type)
{
Q_UNUSED(type)
MainWindow *mw = qobject_cast<MainWindow *>(qApp->activeWindow());
mw->createTab();
return this;
MainWindow *mainWindow = qobject_cast<MainWindow *>(qApp->activeWindow());
return mainWindow->createTab()->m_webView;
}
void WebView::mousePressEvent(QMouseEvent *event)