aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models/divelistmodel.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-02-23 20:18:13 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-01 10:21:44 -0800
commitd6114fc37e922c51341ea71cbcc58543d12f7a49 (patch)
treeb55ec095508a23f61238075f127a0eeb1da95b87 /qt-models/divelistmodel.h
parent6f2a6fef140662e91de508785b3a43211a8b9d20 (diff)
downloadsubsurface-d6114fc37e922c51341ea71cbcc58543d12f7a49.tar.gz
mobile/filter: derive numShown from a new Q_PROPERTY
The number of dives was updated when the model of the list was changed. Since we removed the multi-threading, the model is not disconnected/connected anymore and therefore we don't get the appropriate signal. Instead of introducing a different signal, make the shown-value a Q_PROPERTY. Thus, we can easily send a changed signal if we have to. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/divelistmodel.h')
-rw-r--r--qt-models/divelistmodel.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/qt-models/divelistmodel.h b/qt-models/divelistmodel.h
index b051605ae..110ee82ae 100644
--- a/qt-models/divelistmodel.h
+++ b/qt-models/divelistmodel.h
@@ -47,11 +47,14 @@ public:
Q_INVOKABLE void reload();
QString filterString;
void updateFilterState();
+ Q_PROPERTY(int shown READ shown NOTIFY shownChanged);
+ int shown();
public slots:
int getIdxForId(int id);
void setFilter(QString f, FilterData::Mode mode);
void resetFilter();
- int shown();
+signals:
+ void shownChanged();
protected:
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
private: