diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-06-24 10:23:13 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-06-24 10:23:13 +0200 |
commit | 7f686d7740cab02f92d158df487341dbc0513b61 (patch) | |
tree | e4a8e255309458ae4bc536652ed80d063a3e2753 /src/widgets/webviewtabbar.cpp | |
parent | Fixed crash when closing last tab (diff) | |
download | smolbote-7f686d7740cab02f92d158df487341dbc0513b61.tar.xz |
Some MainWindow and WebViewTabBar cleanup
Diffstat (limited to 'src/widgets/webviewtabbar.cpp')
-rw-r--r-- | src/widgets/webviewtabbar.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/widgets/webviewtabbar.cpp b/src/widgets/webviewtabbar.cpp index d57e095..4d3a859 100644 --- a/src/widgets/webviewtabbar.cpp +++ b/src/widgets/webviewtabbar.cpp @@ -22,7 +22,7 @@ #include "browser.h" #include <QAction> -WebViewTabBar::WebViewTabBar(QWebEngineProfile *profile, QWidget *parent) : +WebViewTabBar::WebViewTabBar(WebEngineProfile *profile, QWidget *parent) : QTabBar(parent) { m_profile = profile; @@ -96,8 +96,10 @@ int WebViewTabBar::addTab(const QUrl &url) return QTabBar::addTab("New Tab"); } -void WebViewTabBar::setProfile(QWebEngineProfile *profile) +void WebViewTabBar::setProfile(WebEngineProfile *profile) { + Q_ASSERT(profile != nullptr); + m_profile = profile; for(auto view : qAsConst(m_views)) { QWebEnginePage *page = new QWebEnginePage(profile); @@ -106,6 +108,11 @@ void WebViewTabBar::setProfile(QWebEngineProfile *profile) } } +WebEngineProfile *WebViewTabBar::profile() +{ + return m_profile; +} + WebView *WebViewTabBar::currentView() { return m_views.at(currentIndex()); |