Merge branch 'staged' into dev

This commit is contained in:
Xiao YiFang 2022-08-08 20:48:57 +08:00
commit d99d8dd788
5 changed files with 8 additions and 10 deletions

View file

@ -16,9 +16,8 @@ ArticleInspector::ArticleInspector( QWidget * parent ) : QWidget( parent, Qt::Wi
resize(800,600);
}
void ArticleInspector::setInspectPage( QWebEngineView * view )
void ArticleInspector::setInspectPage( QWebEnginePage * page )
{
auto page = view->page();
viewContainer->page()->setInspectedPage( page );
#if( QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) )
page->triggerAction( QWebEnginePage::InspectElement );
@ -28,10 +27,12 @@ void ArticleInspector::setInspectPage( QWebEngineView * view )
static bool first{ true };
if( first )
{
qDebug()<<"inspector,phase first time";
first = false;
}
else
{
qDebug()<<"inspector,phase not first time";
page->triggerAction( QWebEnginePage::InspectElement );
}
#endif

View file

@ -13,7 +13,7 @@ class ArticleInspector : public QWidget
public:
ArticleInspector( QWidget * parent = nullptr );
void setInspectPage( QWebEngineView * view);
void setInspectPage( QWebEnginePage * page);
private:
virtual void closeEvent( QCloseEvent * );

View file

@ -528,7 +528,7 @@ void ArticleView::showAnticipation()
void ArticleView::inspectElement()
{
emit inspectSignal( ui.definition );
emit inspectSignal( ui.definition->page() );
}
void ArticleView::loadFinished( bool result )

View file

@ -290,7 +290,7 @@ signals:
/// signal finished javascript;
void notifyJavascriptFinished();
void inspectSignal(QWebEngineView * view);
void inspectSignal(QWebEnginePage * page);
void saveBookmarkSignal( const QString & bookmark );

View file

@ -1655,11 +1655,8 @@ ArticleView * MainWindow::createNewTab( bool switchToIt,
dictionaryBar.toggleViewAction(),
groupList );
connect( view, &ArticleView::inspectSignal,this,[this](QWebEngineView * view){
if( !inspector ){
inspector = new ArticleInspector( this );
}
inspector->setInspectPage( view );
connect( view, &ArticleView::inspectSignal,this,[this](QWebEnginePage * page){
inspector->setInspectPage( page );
});
connect( view, SIGNAL( titleChanged( ArticleView *, QString const & ) ),