diff --git a/src/lib/webtab/tabbedwebview.cpp b/src/lib/webtab/tabbedwebview.cpp index 87ef521d8..743113618 100644 --- a/src/lib/webtab/tabbedwebview.cpp +++ b/src/lib/webtab/tabbedwebview.cpp @@ -49,10 +49,9 @@ TabbedWebView::TabbedWebView(WebTab* webTab) connect(this, SIGNAL(urlChanged(QUrl)), this, SLOT(urlChanged(QUrl))); } -void TabbedWebView::setWebPage(WebPage* page) +void TabbedWebView::setPage(WebPage* page) { - page->setParent(this); - setPage(page); + WebView::setPage(page); connect(page, &WebPage::linkHovered, this, &TabbedWebView::linkHovered); } diff --git a/src/lib/webtab/tabbedwebview.h b/src/lib/webtab/tabbedwebview.h index b30f1b115..0739e8e3a 100644 --- a/src/lib/webtab/tabbedwebview.h +++ b/src/lib/webtab/tabbedwebview.h @@ -1,6 +1,7 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2015 David Rosca +* Copyright (C) 2010-2018 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,7 +37,7 @@ class FALKON_EXPORT TabbedWebView : public WebView public: explicit TabbedWebView(WebTab* webTab); - void setWebPage(WebPage* page); + void setPage(WebPage* page); // BrowserWindow can be null! BrowserWindow* browserWindow() const; diff --git a/src/lib/webtab/webtab.cpp b/src/lib/webtab/webtab.cpp index 7b3ec7c1d..f61f8aa68 100644 --- a/src/lib/webtab/webtab.cpp +++ b/src/lib/webtab/webtab.cpp @@ -117,7 +117,7 @@ WebTab::WebTab(BrowserWindow* window) m_webView = new TabbedWebView(this); m_webView->setBrowserWindow(m_window); - m_webView->setWebPage(new WebPage); + m_webView->setPage(new WebPage); m_webView->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); m_locationBar = new LocationBar(m_window);