diff options
-rw-r--r-- | qt-ui/filtermodels.cpp | 20 | ||||
-rw-r--r-- | qt-ui/filtermodels.h | 18 |
2 files changed, 38 insertions, 0 deletions
diff --git a/qt-ui/filtermodels.cpp b/qt-ui/filtermodels.cpp index 35f9b4103..da123799f 100644 --- a/qt-ui/filtermodels.cpp +++ b/qt-ui/filtermodels.cpp @@ -67,8 +67,28 @@ CREATE_DATA_METHOD( CLASS, COUNTER_FUNCTION ) CREATE_COMMON_METHODS_FOR_FILTER(TagFilterModel, count_dives_with_tag); CREATE_COMMON_METHODS_FOR_FILTER(BuddyFilterModel, count_dives_with_person); CREATE_COMMON_METHODS_FOR_FILTER(LocationFilterModel, count_dives_with_location); +CREATE_COMMON_METHODS_FOR_FILTER(SuitsFilterModel, count_dives_with_location); + CREATE_INSTANCE_METHOD(MultiFilterSortModel); +SuitsFilterModel::SuitsFilterModel(QObject *parent): QStringListModel(parent) +{ +} + +bool SuitsFilterModel::doFilter(dive *d, QModelIndex &index0, QAbstractItemModel *sourceModel) const +{ + return false; +} + +bool SuitsFilterModel::filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const +{ + return false; +} + +void SuitsFilterModel::repopulate() +{ +} + TagFilterModel::TagFilterModel(QObject *parent) : QStringListModel(parent) { } diff --git a/qt-ui/filtermodels.h b/qt-ui/filtermodels.h index 353e9d0a9..3d64356ed 100644 --- a/qt-ui/filtermodels.h +++ b/qt-ui/filtermodels.h @@ -68,6 +68,24 @@ private: explicit LocationFilterModel(QObject *parent = 0); }; +class SuitsFilterModel : public QStringListModel, public MultiFilterInterface{ + Q_OBJECT +public: + static SuitsFilterModel *instance(); + virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); + virtual Qt::ItemFlags flags(const QModelIndex &index) const; + virtual bool filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const; + bool doFilter(struct dive *d, QModelIndex &index0, QAbstractItemModel *sourceModel) const; + void clearFilter(); +public +slots: + void repopulate(); + +private: + explicit SuitsFilterModel(QObject *parent = 0); +}; + class MultiFilterSortModel : public QSortFilterProxyModel { Q_OBJECT public: |