From 1e29ab02abbbeb0f9987e8175438fb339d9a6da4 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Sun, 10 May 2020 23:23:25 +0200 Subject: [PATCH] Make feed property in EntryListModel notifyable --- src/entryListModel.cpp | 1 + src/entryListModel.h | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/entryListModel.cpp b/src/entryListModel.cpp index d67ac0e8..59f23a58 100644 --- a/src/entryListModel.cpp +++ b/src/entryListModel.cpp @@ -66,6 +66,7 @@ void EntryListModel::setFeed(QString url) m_feed = url; setFilter(QStringLiteral("feed ='%1'").arg(url)); select(); + emit feedChanged(url); } QString EntryListModel::feed() const diff --git a/src/entryListModel.h b/src/entryListModel.h index 47d21d77..5e9cd2c1 100644 --- a/src/entryListModel.h +++ b/src/entryListModel.h @@ -27,7 +27,7 @@ class EntryListModel : public QSqlTableModel { Q_OBJECT - Q_PROPERTY(QString feed READ feed WRITE setFeed) + Q_PROPERTY(QString feed READ feed WRITE setFeed NOTIFY feedChanged) public: enum DataRole { Feed = 0, @@ -49,6 +49,9 @@ public: QString feed() const; void setFeed(QString feed); +Q_SIGNALS: + void feedChanged(QString feed); + private: QString m_feed; };