From 7a760b5d20f17de449665ee4fb26059c196489e3 Mon Sep 17 00:00:00 2001 From: aqua Date: Tue, 16 Aug 2022 09:00:40 +0300 Subject: Add rView and WebView --- src/webengine/webview.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/webengine/webview.cpp (limited to 'src/webengine/webview.cpp') diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp new file mode 100644 index 00000000..1aef01e2 --- /dev/null +++ b/src/webengine/webview.cpp @@ -0,0 +1,25 @@ +/* ============================================================ + * The rekonq project + * ============================================================ + * SPDX-License-Identifier: GPL-3.0-only + * Copyright (C) 2022 aqua + * ============================================================ + * Description: Qt WebEngine View + * ============================================================ */ + +#include "webview.h" +#include +#include + +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); +} -- cgit v1.2.1