From f542642c85c3d3249948f594cbef1aa89f56e5c8 Mon Sep 17 00:00:00 2001 From: Xiao YiFang Date: Fri, 19 Aug 2022 19:56:49 +0800 Subject: [PATCH] opt: inspector --- mainwindow.cc | 9 ++++++--- mainwindow.hh | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mainwindow.cc b/mainwindow.cc index 35b10f1e..2c154231 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -1656,9 +1656,7 @@ ArticleView * MainWindow::createNewTab( bool switchToIt, dictionaryBar.toggleViewAction(), groupList ); - connect( view, &ArticleView::inspectSignal,this,[this](QWebEnginePage * page){ - inspector->setInspectPage( page ); - }); + connect( view, &ArticleView::inspectSignal,this,&MainWindow::inspectElement); connect( view, SIGNAL( titleChanged( ArticleView *, QString const & ) ), this, SLOT( titleChanged( ArticleView *, QString const & ) ) ); @@ -1733,6 +1731,11 @@ ArticleView * MainWindow::createNewTab( bool switchToIt, return view; } +void MainWindow::inspectElement( QWebEnginePage * page ) +{ + inspector->setInspectPage( page ); +} + void MainWindow::tabCloseRequested( int x ) { QWidget * w = ui.tabWidget->widget( x ); diff --git a/mainwindow.hh b/mainwindow.hh index d835d8d5..83ee9f5f 100644 --- a/mainwindow.hh +++ b/mainwindow.hh @@ -489,6 +489,8 @@ private slots: void clipboardChange( ); + void inspectElement( QWebEnginePage * ); + signals: /// Set optional parts expand mode for all tabs void setExpandOptionalParts( bool expand );