Create the sorting method.

This method should remove a row on the dive list model
visualization if none of the tags that it have are marked
as 'visible'.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-09-17 16:18:37 -03:00 committed by Dirk Hohndel
parent a6e9a1eab5
commit 4e3689370d
2 changed files with 34 additions and 2 deletions

View file

@ -11,6 +11,7 @@
#include <QCoreApplication>
#include <QStringList>
#include <QStringListModel>
#include <QSortFilterProxyModel>
#include "../dive.h"
#include "../divelist.h"
@ -217,7 +218,6 @@ struct TripItem;
class TreeModel : public QAbstractItemModel {
Q_OBJECT
public:
TreeModel(QObject *parent = 0);
virtual ~TreeModel();
@ -425,10 +425,17 @@ public:
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;
bool *checkState;
public slots:
void repopulate();
private:
explicit TagFilterModel(QObject *parent = 0);
bool *checkState;
};
class TagFilterSortModel : public QSortFilterProxyModel {
Q_OBJECT
public:
TagFilterSortModel(QObject *parent = 0);
virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
};
#endif // MODELS_H