diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2017-12-24 14:35:59 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-12-26 13:08:49 -0800 |
commit | b6bf57a13b5e4d3dd469b0fa8790d341eb4f1304 (patch) | |
tree | e57922eee99f54276adec54d4f277c8f26e1d1ab /qt-models/filtermodels.h | |
parent | b86c70ab2ce91c46355a71008334aa6743caa1e6 (diff) | |
download | subsurface-b6bf57a13b5e4d3dd469b0fa8790d341eb4f1304.tar.gz |
Introduce negate-toggle buttons to filter lists
Introduce toggle buttons which mean "filter all dives except
those fulfilling the selected criteria".
The old code used to check for rowCount() == 0. This should never happen,
because there is always a row "empty field". This check was moved into
the preamble of the functions to seperate it from the actual logic.
Fixes #435
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/filtermodels.h')
-rw-r--r-- | qt-models/filtermodels.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/qt-models/filtermodels.h b/qt-models/filtermodels.h index 9db5e5a97..b866b68b2 100644 --- a/qt-models/filtermodels.h +++ b/qt-models/filtermodels.h @@ -8,6 +8,7 @@ #include <vector> class FilterModelBase : public QStringListModel { + Q_OBJECT public: virtual bool doFilter(struct dive *d, QModelIndex &index0, QAbstractItemModel *sourceModel) const = 0; void clearFilter(); @@ -15,6 +16,10 @@ public: void invertSelection(); std::vector<char> checkState; bool anyChecked; + bool negate; +public +slots: + void setNegate(bool negate); protected: explicit FilterModelBase(QObject *parent = 0); void updateList(const QStringList &new_list); |