Libksieve

sievepreviewgeneratedcodewidget.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 "sievepreviewgeneratedcodewidget.h"
8#include <QHBoxLayout>
9#include <QTextEdit>
10using namespace KSieveUi;
11SievePreviewGeneratedCodeWidget::SievePreviewGeneratedCodeWidget(QWidget *parent)
12 : QWidget(parent)
13 , mTextEdit(new QTextEdit(this))
14{
15 auto mainLayout = new QHBoxLayout(this);
16 mainLayout->setObjectName(QLatin1StringView("mainLayout"));
17 mainLayout->setContentsMargins({});
18
19 mTextEdit->setObjectName(QLatin1StringView("mTextEdit"));
20 mTextEdit->setReadOnly(true);
21 mainLayout->addWidget(mTextEdit);
22}
23
24SievePreviewGeneratedCodeWidget::~SievePreviewGeneratedCodeWidget() = default;
25
26void SievePreviewGeneratedCodeWidget::setCode(const QString &str)
27{
28 mTextEdit->setText(str);
29}
30
31#include "moc_sievepreviewgeneratedcodewidget.cpp"
void setText(const QString &text)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:56:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.