aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/WebView.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/WebView.cpp')
-rw-r--r--src/widgets/WebView.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/widgets/WebView.cpp b/src/widgets/WebView.cpp
index 300f8ae..aead605 100644
--- a/src/widgets/WebView.cpp
+++ b/src/widgets/WebView.cpp
@@ -1,3 +1,4 @@
+#include <QMainWindow>
#include <QWebEngineView>
#include <QtCore>
@@ -5,3 +6,18 @@
WebView::WebView(uint32_t webview_id, QWebEngineProfile *profile, QWidget *parent_node)
: QWebEngineView(profile, parent_node), id(webview_id) {}
+
+void WebView::open_devtools() {
+ if (devtools_window != nullptr)
+ return;
+
+ devtools_window = new DevtoolsWindow(page()->profile());
+ devtools_window->show();
+
+ connect(devtools_window, &DevtoolsWindow::closed, this, [this]() {
+ devtools_window->deleteLater();
+ devtools_window = nullptr;
+ });
+
+ page()->setDevToolsPage(devtools_window->page());
+}