Messagelib

developertoolwidget.cpp
1 /*
2  SPDX-FileCopyrightText: 2020-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "developertoolwidget.h"
8 #include <QVBoxLayout>
9 #include <QWebEnginePage>
10 #include <QWebEngineSettings>
11 #include <QWebEngineView>
12 using namespace WebEngineViewer;
13 DeveloperToolWidget::DeveloperToolWidget(QWidget *parent)
14  : QWidget(parent)
15  , mWebEngineView(new QWebEngineView(this))
16 {
17  auto mainLayout = new QVBoxLayout(this);
18  mainLayout->setObjectName(QStringLiteral("mainLayout"));
19  mainLayout->setContentsMargins({});
20 
21  mWebEngineView->setObjectName(QStringLiteral("mWebEngineView"));
22  mainLayout->addWidget(mWebEngineView);
23  mEnginePage = new QWebEnginePage(this);
24  mEnginePage->setObjectName(QStringLiteral("mEnginePage"));
25  mEnginePage->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
26 
27  mWebEngineView->setPage(mEnginePage);
28 }
29 
30 DeveloperToolWidget::~DeveloperToolWidget() = default;
31 
32 QWebEnginePage *DeveloperToolWidget::enginePage() const
33 {
34  return mEnginePage;
35 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Dec 4 2021 23:12:52 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.