-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
when close inspected windows,the inspect is still working .
- Loading branch information
1 parent
e1730ab
commit ae8c2df
Showing
5 changed files
with
59 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "article_inspect.h" | ||
#include <QCloseEvent> | ||
article_inspect::article_inspect( QWidget * parent ) : QDialog( parent, Qt::WindowType::Window ) | ||
{ | ||
setAttribute( Qt::WidgetAttribute::WA_DeleteOnClose, false ); | ||
QVBoxLayout * v = new QVBoxLayout( this ); | ||
v->setSpacing( 0 ); | ||
v->setContentsMargins( 0, 0, 0, 0 ); | ||
inspectView = new QWebEngineView(); | ||
v->addWidget( inspectView ); | ||
} | ||
|
||
void article_inspect::setInspectPage( QWebEnginePage * page ) | ||
{ | ||
this->inspectedPage = page; | ||
page->setDevToolsPage( inspectView->page() ); | ||
page->triggerAction( QWebEnginePage::InspectElement ); | ||
raise(); | ||
show(); | ||
} | ||
|
||
void article_inspect::closeEvent( QCloseEvent * ev ) | ||
{ | ||
inspectedPage->setDevToolsPage( nullptr ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef ARTICLE_INSPECT_H | ||
#define ARTICLE_INSPECT_H | ||
|
||
#include <QDialog> | ||
#include <QWebEngineView> | ||
#include <QWebEnginePage> | ||
#include <QVBoxLayout> | ||
|
||
class article_inspect : public QDialog | ||
{ | ||
Q_OBJECT | ||
QWebEngineView * inspectView = nullptr; | ||
QWebEnginePage * inspectedPage = nullptr; | ||
public: | ||
article_inspect( QWidget * parent = nullptr ); | ||
|
||
void setInspectPage( QWebEnginePage * page ); | ||
|
||
private: | ||
|
||
virtual void closeEvent( QCloseEvent * ); | ||
}; | ||
|
||
#endif // ARTICLE_INSPECT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters