Libksieve

regexpeditorlineedit.cpp
1/*
2 SPDX-FileCopyrightText: 2017-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "regexpeditorlineedit.h"
8#include <KLineEditEventHandler>
9#include <QHBoxLayout>
10#include <QLineEdit>
11
12using namespace KSieveUi;
13RegexpEditorLineEdit::RegexpEditorLineEdit(QWidget *parent)
14 : KSieveUi::AbstractRegexpEditorLineEdit(parent)
15 , mLineEdit(new QLineEdit(this))
16{
17 auto mainLayout = new QHBoxLayout(this);
18 mainLayout->setObjectName(QLatin1StringView("mainlayout"));
19 mainLayout->setContentsMargins({});
21 mLineEdit->setObjectName(QLatin1StringView("lineedit"));
22 connect(mLineEdit, &QLineEdit::textChanged, this, &RegexpEditorLineEdit::textChanged);
23 mainLayout->addWidget(mLineEdit);
24}
25
26RegexpEditorLineEdit::~RegexpEditorLineEdit() = default;
27
28void RegexpEditorLineEdit::switchToRegexpEditorLineEdit(bool regexpEditor)
29{
30 Q_UNUSED(regexpEditor)
31 // Nothing here
32}
33
34void KSieveUi::RegexpEditorLineEdit::setCode(const QString &str)
35{
36 mLineEdit->setText(str);
37}
38
39QString KSieveUi::RegexpEditorLineEdit::code() const
40{
41 return mLineEdit->text();
42}
43
44void KSieveUi::RegexpEditorLineEdit::setClearButtonEnabled(bool b)
45{
46 mLineEdit->setClearButtonEnabled(b);
47}
48
49void KSieveUi::RegexpEditorLineEdit::setPlaceholderText(const QString &str)
50{
51 mLineEdit->setPlaceholderText(str);
52}
53
54#include "moc_regexpeditorlineedit.cpp"
The AbstractRegexpEditorLineEdit class.
void catchReturnKey(QObject *lineEdit)
void textChanged(const QString &text)
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 Mon Nov 18 2024 12:14:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.