mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24: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);
|
resize(800,600);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArticleInspector::setInspectPage( QWebEngineView * view )
|
void ArticleInspector::setInspectPage( QWebEnginePage * page )
|
||||||
{
|
{
|
||||||
auto page = view->page();
|
|
||||||
viewContainer->page()->setInspectedPage( page );
|
viewContainer->page()->setInspectedPage( page );
|
||||||
#if( QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) )
|
#if( QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) )
|
||||||
page->triggerAction( QWebEnginePage::InspectElement );
|
page->triggerAction( QWebEnginePage::InspectElement );
|
||||||
|
@ -28,10 +27,12 @@ void ArticleInspector::setInspectPage( QWebEngineView * view )
|
||||||
static bool first{ true };
|
static bool first{ true };
|
||||||
if( first )
|
if( first )
|
||||||
{
|
{
|
||||||
|
qDebug()<<"inspector,phase first time";
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
qDebug()<<"inspector,phase not first time";
|
||||||
page->triggerAction( QWebEnginePage::InspectElement );
|
page->triggerAction( QWebEnginePage::InspectElement );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -13,7 +13,7 @@ class ArticleInspector : public QWidget
|
||||||
public:
|
public:
|
||||||
ArticleInspector( QWidget * parent = nullptr );
|
ArticleInspector( QWidget * parent = nullptr );
|
||||||
|
|
||||||
void setInspectPage( QWebEngineView * view);
|
void setInspectPage( QWebEnginePage * page);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
virtual void closeEvent( QCloseEvent * );
|
virtual void closeEvent( QCloseEvent * );
|
||||||
|
|
|
@ -528,7 +528,7 @@ void ArticleView::showAnticipation()
|
||||||
|
|
||||||
void ArticleView::inspectElement()
|
void ArticleView::inspectElement()
|
||||||
{
|
{
|
||||||
emit inspectSignal( ui.definition );
|
emit inspectSignal( ui.definition->page() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArticleView::loadFinished( bool result )
|
void ArticleView::loadFinished( bool result )
|
||||||
|
|
|
@ -290,7 +290,7 @@ signals:
|
||||||
/// signal finished javascript;
|
/// signal finished javascript;
|
||||||
void notifyJavascriptFinished();
|
void notifyJavascriptFinished();
|
||||||
|
|
||||||
void inspectSignal(QWebEngineView * view);
|
void inspectSignal(QWebEnginePage * page);
|
||||||
|
|
||||||
void saveBookmarkSignal( const QString & bookmark );
|
void saveBookmarkSignal( const QString & bookmark );
|
||||||
|
|
||||||
|
|
|
@ -1655,11 +1655,8 @@ ArticleView * MainWindow::createNewTab( bool switchToIt,
|
||||||
dictionaryBar.toggleViewAction(),
|
dictionaryBar.toggleViewAction(),
|
||||||
groupList );
|
groupList );
|
||||||
|
|
||||||
connect( view, &ArticleView::inspectSignal,this,[this](QWebEngineView * view){
|
connect( view, &ArticleView::inspectSignal,this,[this](QWebEnginePage * page){
|
||||||
if( !inspector ){
|
inspector->setInspectPage( page );
|
||||||
inspector = new ArticleInspector( this );
|
|
||||||
}
|
|
||||||
inspector->setInspectPage( view );
|
|
||||||
});
|
});
|
||||||
|
|
||||||
connect( view, SIGNAL( titleChanged( ArticleView *, QString const & ) ),
|
connect( view, SIGNAL( titleChanged( ArticleView *, QString const & ) ),
|
||||||
|
|
Loading…
Reference in a new issue