mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
article inspector debug info
This commit is contained in:
parent
e7f60a9335
commit
c41068d608
|
@ -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
|
||||
|
|
|
@ -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 * );
|
||||
|
|
|
@ -528,7 +528,7 @@ void ArticleView::showAnticipation()
|
|||
|
||||
void ArticleView::inspectElement()
|
||||
{
|
||||
emit inspectSignal( ui.definition );
|
||||
emit inspectSignal( ui.definition->page() );
|
||||
}
|
||||
|
||||
void ArticleView::loadFinished( bool result )
|
||||
|
|
|
@ -290,7 +290,7 @@ signals:
|
|||
/// signal finished javascript;
|
||||
void notifyJavascriptFinished();
|
||||
|
||||
void inspectSignal(QWebEngineView * view);
|
||||
void inspectSignal(QWebEnginePage * page);
|
||||
|
||||
void saveBookmarkSignal( const QString & bookmark );
|
||||
|
||||
|
|
|
@ -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 & ) ),
|
||||
|
|
Loading…
Reference in a new issue