Commit 59ca347f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to show development tools

parent 04b6c45b
......@@ -1743,11 +1743,11 @@ void ViewerPrivate::createActions()
void ViewerPrivate::slotShowDevelopmentTools()
{
mViewer->page()->triggerAction(QWebEnginePage::InspectElement);
DeveloperToolDialog *dlg = new DeveloperToolDialog(nullptr);
dlg->enginePage()->setDevToolsPage(mViewer->page());
dlg->exec();
delete dlg;
mViewer->page()->setDevToolsPage(dlg->enginePage());
mViewer->page()->triggerAction(QWebEnginePage::InspectElement);
connect(dlg, &DeveloperToolDialog::rejected, dlg, &DeveloperToolDialog::deleteLater);
dlg->show();
}
void ViewerPrivate::showContextMenu(KMime::Content *content, const QPoint &pos)
......
......@@ -21,6 +21,7 @@
#include <QVBoxLayout>
#include <QWebEnginePage>
#include <QWebEngineView>
#include <QWebEngineSettings>
using namespace MessageViewer;
DeveloperToolWidget::DeveloperToolWidget(QWidget *parent)
: QWidget(parent)
......@@ -33,6 +34,8 @@ DeveloperToolWidget::DeveloperToolWidget(QWidget *parent)
mWebEngineView->setObjectName(QStringLiteral("mWebEngineView"));
mainLayout->addWidget(mWebEngineView);
mEnginePage = new QWebEnginePage(this);
mEnginePage->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
mWebEngineView->setPage(mEnginePage);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment