From e87693c54ca97ed3a6ed25f9eaae8ab223fc18b1 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Wed, 29 Apr 2020 18:49:07 +0300 Subject: libwebengine Make src/webengine into a static library - Add some tests - Updated manpage - Remove WebProfileManager::id and WebProfileManager::instance - Add consumable semantics checks to WebProfileManager - Add WebProfileManager::walk Add ApplicationMenu class --- src/subwindow/tabwidget.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/subwindow/tabwidget.cpp') diff --git a/src/subwindow/tabwidget.cpp b/src/subwindow/tabwidget.cpp index d09fffb..efa2b6a 100644 --- a/src/subwindow/tabwidget.cpp +++ b/src/subwindow/tabwidget.cpp @@ -17,17 +17,18 @@ #include #include "subwindow.h" -inline WebView *createViewFromInfo(TabWidget::TabInformation &tab, QWidget *parent) +inline WebView *createViewFromInfo(TabWidget::TabInformation &tab, SubWindow *parent) { - auto *view = new WebView(tab.profile, parent); + auto *view = new WebView(tab.profile, std::bind(&SubWindow::createView, parent, std::placeholders::_1), parent); QDataStream stream(&tab.historyBuffer, QIODevice::ReadOnly); stream >> *view->history(); view->history()->goToItem(view->history()->itemAt(tab.historyIndex)); return view; } -TabWidget::TabWidget(QWidget *parent) +TabWidget::TabWidget(SubWindow *parent) : QTabWidget(parent) + , m_parent(parent) { setStyleSheet("QTabBar::tab { width: 200px; }"); @@ -132,7 +133,7 @@ int TabWidget::restoreLastTab() { if(!m_closedTabs.isEmpty()) { TabInformation tab = m_closedTabs.takeLast(); - return addTab(createViewFromInfo(tab, this)); + return addTab(createViewFromInfo(tab, m_parent)); } return -1; } @@ -147,7 +148,7 @@ void TabWidget::restoreTabMenu(QMenu *menu) connect(openAction, &QAction::triggered, this, [this, i]() { TabInformation tab = m_closedTabs.takeAt(i); - addTab(createViewFromInfo(tab, this)); + addTab(createViewFromInfo(tab, m_parent)); }); } -- cgit v1.2.1