Commit 3beb2539 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

RecipientLine: notify on focus change

parent f635e8f5
......@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
set(PIM_VERSION "5.3.67")
set(PIM_VERSION "5.3.68")
set(MESSAGELIB_LIB_VERSION ${PIM_VERSION})
set(AKONADIMIME_LIB_VERSION "5.3.40")
......
......@@ -86,6 +86,7 @@ RecipientLineNG::RecipientLineNG(QWidget *parent)
mEdit->setToolTip(i18n("Set the list of email addresses to receive this message"));
mEdit->setClearButtonEnabled(true);
topLayout->addWidget(mEdit);
mEdit->installEventFilter(this);
connect(mEdit, &RecipientLineEdit::returnPressed, this, &RecipientLineNG::slotReturnPressed);
connect(mEdit, &RecipientLineEdit::deleteMe, this, &RecipientLineNG::slotPropagateDeletion);
......@@ -295,3 +296,14 @@ QString RecipientLineNG::rawData() const
{
return mEdit->text();
}
bool RecipientLineNG::eventFilter(QObject *watched, QEvent *event)
{
if (watched == mEdit) {
if (event->type() == QEvent::FocusIn || event->type() == QEvent::FocusOut) {
Q_EMIT activeChanged();
}
}
return false;
}
......@@ -115,12 +115,16 @@ Q_SIGNALS:
void addRecipient(RecipientLineNG *, const QString &);
void countChanged();
void iconClicked();
void activeChanged();
protected Q_SLOTS:
void slotEditingFinished();
void slotTypeModified();
void analyzeLine(const QString &);
protected:
bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
private:
void dataFromFields();
void fieldsFromData();
......
Supports Markdown
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