Skip to content

Commit

Permalink
optimize:rename inspector class
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyifang committed Mar 5, 2022
1 parent ae8c2df commit edf8c8d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions article_inspect.cpp
Original file line number Diff line number Diff line change
@@ -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 );
Expand All @@ -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() );
Expand All @@ -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 );
}
4 changes: 2 additions & 2 deletions article_inspect.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
2 changes: 1 addition & 1 deletion articleview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion articleview.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit edf8c8d

Please sign in to comment.