fix:F12 crash on qt6.2

This commit is contained in:
xiaoyifang 2022-03-16 08:56:11 +08:00
parent fa2aae908b
commit eebe109e7e
2 changed files with 3 additions and 2 deletions

View file

@ -14,7 +14,10 @@ void ArticleInspector::setInspectPage( QWebEnginePage * page )
{ {
this->inspectedPage = page; this->inspectedPage = page;
page->setDevToolsPage( inspectView->page() ); page->setDevToolsPage( inspectView->page() );
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
//this line will crash application on qt6.2 ,see https://bugreports.qt.io/browse/QTBUG-101724
page->triggerAction( QWebEnginePage::InspectElement ); page->triggerAction( QWebEnginePage::InspectElement );
#endif
raise(); raise();
show(); show();
} }

View file

@ -16,8 +16,6 @@
/// to the view's current state. This is used to open links in new tabs when /// to the view's current state. This is used to open links in new tabs when
/// they are clicked with middle button. There's also an added possibility to /// they are clicked with middle button. There's also an added possibility to
/// get double-click events after the fact with the doubleClicked() signal. /// get double-click events after the fact with the doubleClicked() signal.
/// 2. Manage our own QWebInspector instance. In order to show inspector correctly,
/// use triggerPageAction( QWebEnginePage::InspectElement ) instead.
class ArticleWebView: public QWebEngineView class ArticleWebView: public QWebEngineView
{ {
Q_OBJECT Q_OBJECT