File indexing completed on 2024-12-29 04:54:45
0001 /* 0002 SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "sievepreviewgeneratedcodewidget.h" 0008 #include <QHBoxLayout> 0009 #include <QTextEdit> 0010 using namespace KSieveUi; 0011 SievePreviewGeneratedCodeWidget::SievePreviewGeneratedCodeWidget(QWidget *parent) 0012 : QWidget(parent) 0013 , mTextEdit(new QTextEdit(this)) 0014 { 0015 auto mainLayout = new QHBoxLayout(this); 0016 mainLayout->setObjectName(QLatin1StringView("mainLayout")); 0017 mainLayout->setContentsMargins({}); 0018 0019 mTextEdit->setObjectName(QLatin1StringView("mTextEdit")); 0020 mTextEdit->setReadOnly(true); 0021 mainLayout->addWidget(mTextEdit); 0022 } 0023 0024 SievePreviewGeneratedCodeWidget::~SievePreviewGeneratedCodeWidget() = default; 0025 0026 void SievePreviewGeneratedCodeWidget::setCode(const QString &str) 0027 { 0028 mTextEdit->setText(str); 0029 } 0030 0031 #include "moc_sievepreviewgeneratedcodewidget.cpp"