optimize:rename inspector class

This commit is contained in:
yifang 2022-03-05 19:34:49 +08:00
parent ae8c2df4a8
commit edf8c8d4f3
4 changed files with 7 additions and 7 deletions

View file

@ -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 );
}

View file

@ -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 );

View file

@ -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 );

View file

@ -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