Commit 20b81234 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Remove KLineEdit where it's possibke

parent a196bd3e
......@@ -20,7 +20,7 @@
#include "imagescalingwidget.h"
#include "ui_imagescalingwidget.h"
#include "settings/messagecomposersettings.h"
#include <Libkdepim/LineEditCatchReturnKey>
#include <KLocalizedString>
#include <KMessageBox>
......@@ -61,6 +61,11 @@ ImageScalingWidget::ImageScalingWidget(QWidget *parent)
initComboBox(d->ui->CBMinimumHeight);
initWriteImageFormat();
new KPIM::LineEditCatchReturnKey(d->ui->pattern, this);
new KPIM::LineEditCatchReturnKey(d->ui->renameResizedImagePattern, this);
new KPIM::LineEditCatchReturnKey(d->ui->resizeEmailsPattern, this);
new KPIM::LineEditCatchReturnKey(d->ui->doNotResizePattern, this);
connect(d->ui->enabledAutoResize, &QCheckBox::clicked, this, &ImageScalingWidget::changed);
connect(d->ui->KeepImageRatio, &QCheckBox::clicked, this, &ImageScalingWidget::changed);
connect(d->ui->AskBeforeResizing, &QCheckBox::clicked, this, &ImageScalingWidget::changed);
......@@ -72,18 +77,18 @@ ImageScalingWidget::ImageScalingWidget(QWidget *parent)
connect(d->ui->customMinimumHeight, qOverload<int>(&QSpinBox::valueChanged), this, &ImageScalingWidget::changed);
connect(d->ui->skipImageSizeLower, &QCheckBox::clicked, this, &ImageScalingWidget::changed);
connect(d->ui->imageSize, qOverload<int>(&QSpinBox::valueChanged), this, &ImageScalingWidget::changed);
connect(d->ui->pattern, &KLineEdit::textChanged, this, &ImageScalingWidget::changed);
connect(d->ui->pattern, &QLineEdit::textChanged, this, &ImageScalingWidget::changed);
connect(d->ui->CBMaximumWidth, qOverload<int>(&QComboBox::currentIndexChanged), this, &ImageScalingWidget::slotComboboxChanged);
connect(d->ui->CBMaximumHeight, qOverload<int>(&QComboBox::currentIndexChanged), this, &ImageScalingWidget::slotComboboxChanged);
connect(d->ui->CBMinimumWidth, qOverload<int>(&QComboBox::currentIndexChanged), this, &ImageScalingWidget::slotComboboxChanged);
connect(d->ui->CBMinimumHeight, qOverload<int>(&QComboBox::currentIndexChanged), this, &ImageScalingWidget::slotComboboxChanged);
connect(d->ui->WriteToImageFormat, qOverload<int>(&QComboBox::activated), this, &ImageScalingWidget::changed);
connect(d->ui->renameResizedImage, &QCheckBox::clicked, this, &ImageScalingWidget::changed);
connect(d->ui->renameResizedImage, &QCheckBox::clicked, d->ui->renameResizedImagePattern, &KLineEdit::setEnabled);
connect(d->ui->renameResizedImagePattern, &KLineEdit::textChanged, this, &ImageScalingWidget::changed);
connect(d->ui->renameResizedImage, &QCheckBox::clicked, d->ui->renameResizedImagePattern, &QLineEdit::setEnabled);
connect(d->ui->renameResizedImagePattern, &QLineEdit::textChanged, this, &ImageScalingWidget::changed);
connect(d->ui->resizeEmailsPattern, &KLineEdit::textChanged, this, &ImageScalingWidget::changed);
connect(d->ui->doNotResizePattern, &KLineEdit::textChanged, this, &ImageScalingWidget::changed);
connect(d->ui->resizeEmailsPattern, &QLineEdit::textChanged, this, &ImageScalingWidget::changed);
connect(d->ui->doNotResizePattern, &QLineEdit::textChanged, this, &ImageScalingWidget::changed);
connect(d->ui->resizeImageWithFormatsType, &MessageComposer::ImageScalingSelectFormat::textChanged, this, &ImageScalingWidget::changed);
connect(d->ui->resizeImageWithFormats, &QCheckBox::clicked, this, &ImageScalingWidget::changed);
connect(d->ui->resizeImageWithFormats, &QCheckBox::clicked, d->ui->resizeImageWithFormatsType, &MessageComposer::ImageScalingSelectFormat::setEnabled);
......
......@@ -303,7 +303,7 @@
</widget>
</item>
<item>
<widget class="KLineEdit" name="pattern">
<widget class="QLineEdit" name="pattern">
<property name="whatsThis">
<string>This line allows to define several pattern. Separate them with ';'.</string>
</property>
......@@ -313,9 +313,6 @@
<property name="showClearButton" stdset="0">
<bool>true</bool>
</property>
<property name="trapReturnKey">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
......@@ -362,13 +359,10 @@
</spacer>
</item>
<item row="1" column="0">
<widget class="KLineEdit" name="renameResizedImagePattern">
<widget class="QLineEdit" name="renameResizedImagePattern">
<property name="showClearButton" stdset="0">
<bool>true</bool>
</property>
<property name="trapReturnKey">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
......@@ -420,16 +414,13 @@
</widget>
</item>
<item>
<widget class="KLineEdit" name="resizeEmailsPattern">
<widget class="QLineEdit" name="resizeEmailsPattern">
<property name="placeholderText">
<string>Specify patterns separate with ';'</string>
</property>
<property name="showClearButton" stdset="0">
<bool>true</bool>
</property>
<property name="trapReturnKey">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -447,16 +438,13 @@
</widget>
</item>
<item>
<widget class="KLineEdit" name="doNotResizePattern">
<widget class="QLineEdit" name="doNotResizePattern">
<property name="placeholderText">
<string>Specify patterns separate with ';'</string>
</property>
<property name="showClearButton" stdset="0">
<bool>true</bool>
</property>
<property name="trapReturnKey">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -479,12 +467,6 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>MessageComposer::ImageScalingSelectFormat</class>
<extends>QWidget</extends>
......
......@@ -22,7 +22,7 @@
#include "core/aggregation.h"
#include "utils/comboboxutils.h"
#include <KLineEdit>
#include <QLineEdit>
#include <KTextEdit>
#include <QLabel>
#include <QGridLayout>
......
......@@ -24,7 +24,7 @@
#include <QLabel>
#include <QGridLayout>
#include <KLineEdit>
#include <QLineEdit>
#include <KLocalizedString>
#include <KTextEdit>
......@@ -43,11 +43,11 @@ OptionSetEditor::OptionSetEditor(QWidget *parent)
QLabel *l = new QLabel(i18nc("@label:textbox Name of the option", "Name:"), tab);
tabg->addWidget(l, 0, 0);
mNameEdit = new KLineEdit(tab);
mNameEdit = new QLineEdit(tab);
tabg->addWidget(mNameEdit, 0, 1);
connect(mNameEdit, &KLineEdit::textEdited, this, &OptionSetEditor::slotNameEditTextEdited);
connect(mNameEdit, &QLineEdit::textEdited, this, &OptionSetEditor::slotNameEditTextEdited);
l = new QLabel(i18nc("@label:textbox Description of the option", "Description:"), tab);
tabg->addWidget(l, 1, 0);
......@@ -75,7 +75,7 @@ KTextEdit *OptionSetEditor::descriptionEdit() const
return mDescriptionEdit;
}
KLineEdit *OptionSetEditor::nameEdit() const
QLineEdit *OptionSetEditor::nameEdit() const
{
return mNameEdit;
}
......@@ -23,7 +23,7 @@
#include <QTabWidget>
class KLineEdit;
class QLineEdit;
class KTextEdit;
namespace MessageList {
......@@ -50,7 +50,7 @@ protected:
* Returns the editor for the name of the OptionSet.
* Derived classes are responsable of filling this UI element and reading back data from it.
*/
KLineEdit *nameEdit() const;
QLineEdit *nameEdit() const;
/**
* Returns the editor for the description of the OptionSet.
......@@ -66,7 +66,7 @@ protected Q_SLOTS:
virtual void slotNameEditTextEdited(const QString &newName) = 0;
private:
KLineEdit *mNameEdit = nullptr; ///< The editor for the OptionSet name
QLineEdit *mNameEdit = nullptr; ///< The editor for the OptionSet name
KTextEdit *mDescriptionEdit = nullptr; ///< The editor for the OptionSet description
};
} // namespace Utils
......
......@@ -49,7 +49,7 @@
#include <QColorDialog>
#include <QComboBox>
#include <KLineEdit>
#include <QLineEdit>
#include <KLocalizedString>
#include <QMenu>
#include <KIconLoader>
......@@ -85,7 +85,7 @@ ThemeColumnPropertiesDialog::ThemeColumnPropertiesDialog(QWidget *parent, Theme:
QLabel *l = new QLabel(i18nc("@label:textbox Property name", "Name:"), base);
g->addWidget(l, 0, 0);
mNameEdit = new KLineEdit(base);
mNameEdit = new QLineEdit(base);
mNameEdit->setToolTip(i18n("The label that will be displayed in the column header."));
g->addWidget(mNameEdit, 0, 1);
......
......@@ -35,7 +35,7 @@ class QCheckBox;
class QComboBox;
class KPluralHandlingSpinBox;
class KLineEdit;
class QLineEdit;
namespace MessageList {
namespace Core {
......@@ -55,7 +55,7 @@ public:
protected:
Core::Theme::Column *mColumn = nullptr;
KLineEdit *mNameEdit = nullptr;
QLineEdit *mNameEdit = nullptr;
QCheckBox *mVisibleByDefaultCheck = nullptr;
QCheckBox *mIsSenderOrReceiverCheck = nullptr;
QComboBox *mMessageSortingCombo = nullptr;
......
......@@ -60,6 +60,7 @@ target_link_libraries(KF5TemplateParser
KF5::SonnetUi
KF5::SyntaxHighlighting
Qt5::WebEngineWidgets
KF5::Libkdepim
)
set_target_properties(KF5TemplateParser PROPERTIES
VERSION ${TEMPLATEPARSER_VERSION_STRING}
......
......@@ -23,6 +23,7 @@
#include "globalsettings_templateparser.h"
#include "ui_customtemplates_base.h"
#include <KPIMTextEdit/PlainTextEditor>
#include <Libkdepim/LineEditCatchReturnKey>
#include "templateparseremailaddressrequesterinterfacewidget.h"
#include <KLocalizedString>
......@@ -51,15 +52,15 @@ CustomTemplates::CustomTemplates(const QList<KActionCollection *> &actionCollect
mUi->mList->header()->setSectionsMovable(false);
mUi->mEditFrame->setEnabled(false);
mUi->mName->setTrapReturnKey(true);
new KPIM::LineEditCatchReturnKey(mUi->mName, this);
connect(mUi->mEdit->editor(), &QPlainTextEdit::textChanged,
this, &CustomTemplates::slotTextChanged);
connect(mUi->mToEdit, &TemplateParser::TemplateParserEmailAddressRequesterInterfaceWidget::textChanged, this, &CustomTemplates::slotTextChanged);
connect(mUi->mCCEdit, &TemplateParser::TemplateParserEmailAddressRequesterInterfaceWidget::textChanged, this, &CustomTemplates::slotTextChanged);
connect(mUi->mName, &KLineEdit::textChanged, this, &CustomTemplates::slotNameChanged);
connect(mUi->mName, &QLineEdit::textChanged, this, &CustomTemplates::slotNameChanged);
connect(mUi->mName, &KLineEdit::returnPressed, this, &CustomTemplates::slotAddClicked);
connect(mUi->mName, &QLineEdit::returnPressed, this, &CustomTemplates::slotAddClicked);
connect(mUi->mInsertCommand, qOverload<const QString &, int>(&TemplateParser::TemplatesInsertCommandPushButton::insertCommand), this, &CustomTemplates::slotInsertCommand);
......@@ -482,7 +483,7 @@ CustomTemplateItemDelegate::~CustomTemplateItemDelegate()
void CustomTemplateItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
{
KLineEdit *lineEdit = static_cast<KLineEdit *>(editor);
QLineEdit *lineEdit = static_cast<QLineEdit *>(editor);
const QString text = lineEdit->text();
if (!text.isEmpty()) {
model->setData(index, text, Qt::EditRole);
......
......@@ -69,7 +69,7 @@
<number>0</number>
</property>
<item>
<widget class="KLineEdit" name="mName">
<widget class="QLineEdit" name="mName">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
......@@ -347,12 +347,6 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KKeySequenceWidget</class>
<extends>QWidget</extends>
......
......@@ -22,7 +22,7 @@
#include <QIcon>
#include <KLocalizedString>
#include <KLineEdit>
#include <QLineEdit>
#include <KColorScheme>
#include <QHBoxLayout>
......
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