Commit e4d2856d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Continue to implement preview code

parent 9c1a926f
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "sievepreviewgeneratedcodewidget.h" #include "sievepreviewgeneratedcodewidget.h"
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QTextEdit>
using namespace KSieveUi; using namespace KSieveUi;
SievePreviewGeneratedCodeWidget::SievePreviewGeneratedCodeWidget(QWidget *parent) SievePreviewGeneratedCodeWidget::SievePreviewGeneratedCodeWidget(QWidget *parent)
: QWidget(parent) : QWidget(parent)
...@@ -26,9 +27,19 @@ SievePreviewGeneratedCodeWidget::SievePreviewGeneratedCodeWidget(QWidget *parent ...@@ -26,9 +27,19 @@ SievePreviewGeneratedCodeWidget::SievePreviewGeneratedCodeWidget(QWidget *parent
QHBoxLayout *mainLayout = new QHBoxLayout(this); QHBoxLayout *mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout")); mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins(0, 0, 0, 0); mainLayout->setContentsMargins(0, 0, 0, 0);
mTextEdit = new QTextEdit(this);
mTextEdit->setObjectName(QStringLiteral("mTextEdit"));
mTextEdit->setReadOnly(true);
mainLayout->addWidget(mTextEdit);
} }
SievePreviewGeneratedCodeWidget::~SievePreviewGeneratedCodeWidget() SievePreviewGeneratedCodeWidget::~SievePreviewGeneratedCodeWidget()
{ {
} }
void SievePreviewGeneratedCodeWidget::setCode(const QString &str)
{
mTextEdit->setText(str);
}
...@@ -28,6 +28,8 @@ class SievePreviewGeneratedCodeWidget : public QWidget ...@@ -28,6 +28,8 @@ class SievePreviewGeneratedCodeWidget : public QWidget
public: public:
explicit SievePreviewGeneratedCodeWidget(QWidget *parent = nullptr); explicit SievePreviewGeneratedCodeWidget(QWidget *parent = nullptr);
~SievePreviewGeneratedCodeWidget(); ~SievePreviewGeneratedCodeWidget();
void setCode(const QString &str);
private: private:
QTextEdit *mTextEdit = nullptr; QTextEdit *mTextEdit = nullptr;
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment