Libksieve

regexpeditorlineedit.cpp
1 /*
2  SPDX-FileCopyrightText: 2017-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #include "regexpeditorlineedit.h"
8 #include <Libkdepim/LineEditCatchReturnKey>
9 #include <QHBoxLayout>
10 #include <QLineEdit>
11 
12 using namespace KSieveUi;
13 RegexpEditorLineEdit::RegexpEditorLineEdit(QWidget *parent)
15 {
16  auto mainLayout = new QHBoxLayout(this);
17  mainLayout->setObjectName(QStringLiteral("mainlayout"));
18  mainLayout->setContentsMargins({});
19  mLineEdit = new QLineEdit(this);
20  new KPIM::LineEditCatchReturnKey(mLineEdit, this);
21  mLineEdit->setObjectName(QStringLiteral("lineedit"));
22  connect(mLineEdit, &QLineEdit::textChanged, this, &RegexpEditorLineEdit::textChanged);
23  mainLayout->addWidget(mLineEdit);
24 }
25 
26 RegexpEditorLineEdit::~RegexpEditorLineEdit()
27 {
28 }
29 
30 void RegexpEditorLineEdit::switchToRegexpEditorLineEdit(bool regexpEditor)
31 {
32  Q_UNUSED(regexpEditor)
33  // Nothing here
34 }
35 
36 void KSieveUi::RegexpEditorLineEdit::setCode(const QString &str)
37 {
38  mLineEdit->setText(str);
39 }
40 
41 QString KSieveUi::RegexpEditorLineEdit::code() const
42 {
43  return mLineEdit->text();
44 }
45 
46 void KSieveUi::RegexpEditorLineEdit::setClearButtonEnabled(bool b)
47 {
48  mLineEdit->setClearButtonEnabled(b);
49 }
50 
51 void KSieveUi::RegexpEditorLineEdit::setPlaceholderText(const QString &str)
52 {
53  mLineEdit->setPlaceholderText(str);
54 }
void textChanged(const QString &text)
The AbstractRegexpEditorLineEdit class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Apr 17 2021 23:09:33 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.