[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kphotoalbum] AnnotationDialog: Ensure that ListSelect filter is cleared when AreaTagSelectDialog cl
From: Johannes Zarl-Zierl <johannes () zarl-zierl ! at>
Date: 2016-12-02 15:29:52
Message-ID: E1cCpma-0004uW-4R () code ! kde ! org
[Download RAW message or body]
Git commit c77a11c6846156d0568e596af5a6e73a32686f3f by Johannes Zarl-Zierl.
Committed on 02/12/2016 at 15:29.
Pushed by johanneszarl into branch 'master'.
Ensure that ListSelect filter is cleared when AreaTagSelectDialog closes
M +15 -1 AnnotationDialog/AreaTagSelectDialog.cpp
M +1 -0 AnnotationDialog/AreaTagSelectDialog.h
https://commits.kde.org/kphotoalbum/c77a11c6846156d0568e596af5a6e73a32686f3f
diff --git a/AnnotationDialog/AreaTagSelectDialog.cpp b/AnnotationDialog/AreaTagSelectDialog.cpp
index 59d9015..a855ec1 100644
--- a/AnnotationDialog/AreaTagSelectDialog.cpp
+++ b/AnnotationDialog/AreaTagSelectDialog.cpp
@@ -36,6 +36,12 @@
#include <QMenu>
#include <QPainter>
+#ifdef DEBUG_AnnotationDialog
+#define Debug qDebug
+#else
+#define Debug if(0) qDebug
+#endif
+
AnnotationDialog::AreaTagSelectDialog::AreaTagSelectDialog(AnnotationDialog::ResizableFrame *area,
ListSelect *ls,
QPixmap areaImage,
@@ -70,10 +76,11 @@ AnnotationDialog::AreaTagSelectDialog::AreaTagSelectDialog(AnnotationDialog::Res
QMenu *tagMenu = new QMenu();
m_area->addTagActions(tagMenu);
mainLayout->addWidget(tagMenu, 2, 0, 1, 2);
- connect(tagMenu, &QMenu::triggered, this, &QMenu::close);
+ connect(tagMenu, &QMenu::triggered, this, &QDialog::accept);
connect(tagSelect, &KLineEdit::returnPressed, this, &AreaTagSelectDialog::slotSetTag);
connect(tagSelect, &QLineEdit::textChanged, this, &AreaTagSelectDialog::slotValidateTag);
+ connect(this, &QDialog::finished, this, &AreaTagSelectDialog::slotFinished);
}
void AnnotationDialog::AreaTagSelectDialog::slotSetTag(const QString &tag)
@@ -82,6 +89,7 @@ void AnnotationDialog::AreaTagSelectDialog::slotSetTag(const QString &tag)
if (m_dialog->positionableTagAvailable(m_listSelect->category(), enteredText))
{
const auto currentTagData = m_area->tagData();
+ // was there already a tag associated?
if( !currentTagData.first.isEmpty())
{
// Deselect the tag
@@ -105,6 +113,12 @@ void AnnotationDialog::AreaTagSelectDialog::slotValidateTag(const QString &tag)
}
}
+void AnnotationDialog::AreaTagSelectDialog::slotFinished()
+{
+ // remove filter from listSelect
+ m_listSelect->showOnlyItemsMatching( QString() );
+}
+
void AnnotationDialog::AreaTagSelectDialog::paintEvent(QPaintEvent*)
{
QColor backgroundColor = Qt::white;
diff --git a/AnnotationDialog/AreaTagSelectDialog.h b/AnnotationDialog/AreaTagSelectDialog.h
index f548918..1baf7ad 100644
--- a/AnnotationDialog/AreaTagSelectDialog.h
+++ b/AnnotationDialog/AreaTagSelectDialog.h
@@ -56,6 +56,7 @@ protected:
private slots:
void slotSetTag(const QString& tag);
void slotValidateTag(const QString &tag);
+ void slotFinished();
private:
QLabel *m_areaImageLabel;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic