summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <dvratil@kde.org>2016-10-03 16:57:44 (GMT)
committerDaniel Vrátil <dvratil@kde.org>2016-10-03 16:57:44 (GMT)
commit3beb253925ca46db7d235d58c9be94d9dc0942e1 (patch)
tree0cf9aa0ef7528a3937386ed0104a607555dfa9b9
parentf635e8f54f2a5c26e97391641b18579dde8e91a1 (diff)
RecipientLine: notify on focus change
-rw-r--r--CMakeLists.txt2
-rw-r--r--messagecomposer/src/recipient/recipientline.cpp12
-rw-r--r--messagecomposer/src/recipient/recipientline.h4
3 files changed, 17 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ed5a5f..8620ada 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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")
diff --git a/messagecomposer/src/recipient/recipientline.cpp b/messagecomposer/src/recipient/recipientline.cpp
index fa7a623..afaf7aa 100644
--- a/messagecomposer/src/recipient/recipientline.cpp
+++ b/messagecomposer/src/recipient/recipientline.cpp
@@ -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;
+}
diff --git a/messagecomposer/src/recipient/recipientline.h b/messagecomposer/src/recipient/recipientline.h
index e2f5100..d9775d8 100644
--- a/messagecomposer/src/recipient/recipientline.h
+++ b/messagecomposer/src/recipient/recipientline.h
@@ -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();