From e46b1e88d92990d26d34981baf70fcf0b58ebec7 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 27 Nov 2019 21:55:37 +0100 Subject: Selection: move translation of indexes to filter model The DiveListView caught signals from the DiveTripModel with the corresponding indexes. However, the DiveListView is actually connected to the MultiFilterSortModel and thus has to translate the indexes. Instead, catch the signals in the MultiFilterSortModel, transform them and resend. Let the DiveListView get its signal from the MultiFilterSortModel. Yes, this makes things less efficient because there is an extra signal. On the upside, the makes data-flow much more logical. Selection will have to be fixed anyway. Signed-off-by: Berthold Stoeger --- qt-models/filtermodels.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'qt-models/filtermodels.h') diff --git a/qt-models/filtermodels.h b/qt-models/filtermodels.h index 2dcce0fc0..6677c713d 100644 --- a/qt-models/filtermodels.h +++ b/qt-models/filtermodels.h @@ -14,6 +14,12 @@ public: bool lessThan(const QModelIndex &, const QModelIndex &) const override; void resetModel(DiveTripModelBase::Layout layout); +signals: + void selectionChanged(const QVector &indexes); + void currentDiveChanged(QModelIndex index); +private slots: + void selectionChangedSlot(const QVector &indexes); + void currentDiveChangedSlot(QModelIndex index); private: MultiFilterSortModel(QObject *parent = 0); }; -- cgit v1.2.3-70-g09d2