diff options
Diffstat (limited to 'qt-models/divelistmodel.h')
-rw-r--r-- | qt-models/divelistmodel.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/qt-models/divelistmodel.h b/qt-models/divelistmodel.h index caf2616a7..dcfc573ee 100644 --- a/qt-models/divelistmodel.h +++ b/qt-models/divelistmodel.h @@ -12,6 +12,7 @@ class DiveListSortModel : public QSortFilterProxyModel Q_OBJECT public: DiveListSortModel(QObject *parent = 0); + void setSourceModel(QAbstractItemModel *sourceModel); Q_INVOKABLE void addAllDives(); Q_INVOKABLE void clear(); public slots: @@ -20,6 +21,12 @@ public slots: void setFilter(QString f); void resetFilter(); int shown(); +protected: + bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; +private: + std::vector<unsigned char> filteredRows; // using unsigned char because using 'bool' turns this into a bitfield + QString filterString; + void updateFilterState(); }; class DiveListModel : public QAbstractListModel |