From 3323b83af3bc0cd4feff0e0463718e77d4eabef7 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Wed, 20 Dec 2017 12:53:40 +0100 Subject: Can now open links in new tab --- src/widgets/mainwindowtabbar.cpp | 6 +++--- src/widgets/mainwindowtabbar.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/mainwindowtabbar.cpp b/src/widgets/mainwindowtabbar.cpp index e7209c4..9991043 100644 --- a/src/widgets/mainwindowtabbar.cpp +++ b/src/widgets/mainwindowtabbar.cpp @@ -112,7 +112,7 @@ QSize MainWindowTabBar::tabSizeHint(int index) const void MainWindowTabBar::handleCurrentChanged(int index) { if(index < 0) { - addTab(createWebView(m_parent->profile()->homepage(), m_parent->profile())); + addTab(createWebView(m_parent->profile()->homepage(), m_parent->profile(), m_parent)); return; } @@ -141,9 +141,9 @@ void MainWindowTabBar::updateVectorArrangement(int from, int to) m_views.move(from, to); } -WebView *createWebView(const QUrl &url, WebEngineProfile *profile) +WebView *createWebView(const QUrl &url, WebEngineProfile *profile, MainWindow *parent) { - WebView *view = new WebView(nullptr); + WebView *view = new WebView(parent); QWebEnginePage *page = new QWebEnginePage(profile); view->setPage(page); page->load(url); diff --git a/src/widgets/mainwindowtabbar.h b/src/widgets/mainwindowtabbar.h index c8ccfb4..67f51e0 100644 --- a/src/widgets/mainwindowtabbar.h +++ b/src/widgets/mainwindowtabbar.h @@ -50,6 +50,6 @@ private: MainWindow *m_parent; }; -WebView *createWebView(const QUrl &url, WebEngineProfile *profile); +WebView *createWebView(const QUrl &url, WebEngineProfile *profile, MainWindow *parent); #endif // WEBVIEWTABBAR_H -- cgit v1.2.1