Messagelib

developertoolwidget.cpp
1/*
2 SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
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>
12using namespace WebEngineViewer;
13DeveloperToolWidget::DeveloperToolWidget(QWidget *parent)
14 : QWidget(parent)
15 , mWebEngineView(new QWebEngineView(this))
16 , mEnginePage(new QWebEnginePage(this))
17{
18 auto mainLayout = new QVBoxLayout(this);
19 mainLayout->setObjectName(QLatin1StringView("mainLayout"));
20 mainLayout->setContentsMargins({});
21
22 mWebEngineView->setObjectName(QLatin1StringView("mWebEngineView"));
23 mainLayout->addWidget(mWebEngineView);
24 mEnginePage->setObjectName(QLatin1StringView("mEnginePage"));
25 mEnginePage->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
26
27 mWebEngineView->setPage(mEnginePage);
28 connect(mEnginePage, &QWebEnginePage::windowCloseRequested, this, &DeveloperToolWidget::closeRequested);
29}
30
31DeveloperToolWidget::~DeveloperToolWidget() = default;
32
33QWebEnginePage *DeveloperToolWidget::enginePage() const
34{
35 return mEnginePage;
36}
37
38#include "moc_developertoolwidget.cpp"
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:50:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.