summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-09-17 16:18:37 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-09-17 15:28:21 -0700
commit4e3689370d8e81716759a5b29934c35cf848a379 (patch)
treeba31729f83291facedc3ddc232aa23e815371031 /qt-ui/models.h
parenta6e9a1eab561af3255d99d31011c57135a90ca3f (diff)
downloadsubsurface-4e3689370d8e81716759a5b29934c35cf848a379.tar.gz
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>
Diffstat (limited to 'qt-ui/models.h')
-rw-r--r--qt-ui/models.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/qt-ui/models.h b/qt-ui/models.h
index c54a765ab..446ae9047 100644
--- a/qt-ui/models.h
+++ b/qt-ui/models.h
@@ -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