mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
optimize:rename inspector class
This commit is contained in:
parent
ae8c2df4a8
commit
edf8c8d4f3
|
@ -1,6 +1,6 @@
|
|||
#include "article_inspect.h"
|
||||
#include <QCloseEvent>
|
||||
article_inspect::article_inspect( QWidget * parent ) : QDialog( parent, Qt::WindowType::Window )
|
||||
ArticleInspector::ArticleInspector( QWidget * parent ) : QDialog( parent, Qt::WindowType::Window )
|
||||
{
|
||||
setAttribute( Qt::WidgetAttribute::WA_DeleteOnClose, false );
|
||||
QVBoxLayout * v = new QVBoxLayout( this );
|
||||
|
@ -10,7 +10,7 @@ article_inspect::article_inspect( QWidget * parent ) : QDialog( parent, Qt::Wind
|
|||
v->addWidget( inspectView );
|
||||
}
|
||||
|
||||
void article_inspect::setInspectPage( QWebEnginePage * page )
|
||||
void ArticleInspector::setInspectPage( QWebEnginePage * page )
|
||||
{
|
||||
this->inspectedPage = page;
|
||||
page->setDevToolsPage( inspectView->page() );
|
||||
|
@ -19,7 +19,7 @@ void article_inspect::setInspectPage( QWebEnginePage * page )
|
|||
show();
|
||||
}
|
||||
|
||||
void article_inspect::closeEvent( QCloseEvent * ev )
|
||||
void ArticleInspector::closeEvent( QCloseEvent * ev )
|
||||
{
|
||||
inspectedPage->setDevToolsPage( nullptr );
|
||||
}
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
#include <QWebEnginePage>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
class article_inspect : public QDialog
|
||||
class ArticleInspector : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
QWebEngineView * inspectView = nullptr;
|
||||
QWebEnginePage * inspectedPage = nullptr;
|
||||
public:
|
||||
article_inspect( QWidget * parent = nullptr );
|
||||
ArticleInspector( QWidget * parent = nullptr );
|
||||
|
||||
void setInspectPage( QWebEnginePage * page );
|
||||
|
||||
|
|
|
@ -509,7 +509,7 @@ void ArticleView::inspectElement(){
|
|||
QWebEnginePage *page = ui.definition->page();
|
||||
if( inspector == nullptr )
|
||||
{
|
||||
inspector = new article_inspect( this );
|
||||
inspector = new ArticleInspector( this );
|
||||
inspector->setWindowTitle( tr( "Inspect" ) );
|
||||
}
|
||||
inspector->setInspectPage( page );
|
||||
|
|
|
@ -46,7 +46,7 @@ class ArticleView: public QFrame
|
|||
QString rangeVarName;
|
||||
|
||||
//used to hold the F12 inspect source view.
|
||||
article_inspect * inspector = nullptr;
|
||||
ArticleInspector * inspector = nullptr;
|
||||
|
||||
/// Any resource we've decided to download off the dictionary gets stored here.
|
||||
/// Full vector capacity is used for search requests, where we have to make
|
||||
|
|
Loading…
Reference in a new issue