aboutsummaryrefslogtreecommitdiff
path: root/src/widgets
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-12-20 12:53:40 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2017-12-20 12:53:40 +0100
commit3323b83af3bc0cd4feff0e0463718e77d4eabef7 (patch)
treebea0abe418c808f8f089a642e098c993b29af143 /src/widgets
parentChanged license from GPL3+ to GPL3 (diff)
downloadsmolbote-3323b83af3bc0cd4feff0e0463718e77d4eabef7.tar.xz
Can now open links in new tab
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/mainwindowtabbar.cpp6
-rw-r--r--src/widgets/mainwindowtabbar.h2
2 files changed, 4 insertions, 4 deletions
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