summaryrefslogtreecommitdiff
path: root/plugins/webengine/webview.cpp
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2022-08-16 16:19:04 +0300
committeraqua <aqua@iserlohn-fortress.net>2022-08-16 16:19:04 +0300
commit616e680aa8af8f5056b5133dd44258c252ca656f (patch)
tree4c89c4fe2b9b2cc77c550c8d52d6d1058ee10846 /plugins/webengine/webview.cpp
parentAdd rView and WebView (diff)
downloadrekonq-616e680aa8af8f5056b5133dd44258c252ca656f.tar.xz
Turn WebEngine into a plugin
Diffstat (limited to 'plugins/webengine/webview.cpp')
-rw-r--r--plugins/webengine/webview.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/webengine/webview.cpp b/plugins/webengine/webview.cpp
new file mode 100644
index 00000000..1aef01e2
--- /dev/null
+++ b/plugins/webengine/webview.cpp
@@ -0,0 +1,25 @@
+/* ============================================================
+ * The rekonq project
+ * ============================================================
+ * SPDX-License-Identifier: GPL-3.0-only
+ * Copyright (C) 2022 aqua <aqua@iserlohn-fortress.net>
+ * ============================================================
+ * Description: Qt WebEngine View
+ * ============================================================ */
+
+#include "webview.h"
+#include <QVBoxLayout>
+#include <QWebEngineView>
+
+WebView::WebView(const QUrl &url, QWidget *parent) : rView(url, parent), view(new QWebEngineView(this))
+{
+ auto *layout = new QVBoxLayout;
+ layout->setContentsMargins(0, 0, 0, 0);
+ layout->addWidget(view);
+ setLayout(layout);
+
+ connect(view, &QWebEngineView::iconChanged, this, [this](const QIcon &icon) { emit iconChanged(icon); });
+ connect(view, &QWebEngineView::urlChanged, this, [this](const QUrl &url) { emit urlChanged(url); });
+ connect(view, &QWebEngineView::titleChanged, this, [this](const QString &title) { emit titleChanged(title); });
+ view->load(url);
+}