opt: inspector

This commit is contained in:
Xiao YiFang 2022-08-19 19:56:49 +08:00
parent a205d22139
commit f542642c85
2 changed files with 8 additions and 3 deletions

View file

@ -1656,9 +1656,7 @@ ArticleView * MainWindow::createNewTab( bool switchToIt,
dictionaryBar.toggleViewAction(), dictionaryBar.toggleViewAction(),
groupList ); groupList );
connect( view, &ArticleView::inspectSignal,this,[this](QWebEnginePage * page){ connect( view, &ArticleView::inspectSignal,this,&MainWindow::inspectElement);
inspector->setInspectPage( page );
});
connect( view, SIGNAL( titleChanged( ArticleView *, QString const & ) ), connect( view, SIGNAL( titleChanged( ArticleView *, QString const & ) ),
this, SLOT( titleChanged( ArticleView *, QString const & ) ) ); this, SLOT( titleChanged( ArticleView *, QString const & ) ) );
@ -1733,6 +1731,11 @@ ArticleView * MainWindow::createNewTab( bool switchToIt,
return view; return view;
} }
void MainWindow::inspectElement( QWebEnginePage * page )
{
inspector->setInspectPage( page );
}
void MainWindow::tabCloseRequested( int x ) void MainWindow::tabCloseRequested( int x )
{ {
QWidget * w = ui.tabWidget->widget( x ); QWidget * w = ui.tabWidget->widget( x );

View file

@ -489,6 +489,8 @@ private slots:
void clipboardChange( ); void clipboardChange( );
void inspectElement( QWebEnginePage * );
signals: signals:
/// Set optional parts expand mode for all tabs /// Set optional parts expand mode for all tabs
void setExpandOptionalParts( bool expand ); void setExpandOptionalParts( bool expand );