Isis Developer Reference
SortFilterProxyModel.h
Go to the documentation of this file.
1#ifndef SortFilterProxyModel_h
2#define SortFilterProxyModel_h
3
10/* SPDX-License-Identifier: CC0-1.0 */
11
12#include <QList>
13#include <QIdentityProxyModel>
14#include <QModelIndex>
15#include <QPersistentModelIndex>
16#include <QSortFilterProxyModel>
17
18class QAbstractProxyModel;
19class QObject;
20class QStandardItem;
21
22class QVariant;
23
24namespace Isis {
25
26class ProjectItem;
27class ProjectItemModel;
28
39 Q_OBJECT
40
41 public:
42 explicit SortFilterProxyModel(QObject *parent = 0);
43
44 //QModelIndex mapFromSource(const QModelIndex &sourceIndex) const Q_DECL_OVERRIDE;
45 //QModelIndex mapToSource(const QModelIndex &proxyIndex) const Q_DECL_OVERRIDE;
46
47 //void setSourceModel(ProjectItemModel *newSourceModel) Q_DECL_OVERRIDE;
48 void setSourceModel(ProjectItemModel *newSourceModel);
49
50 bool setRoot(const QStandardItem *item);
51
52 void setSelectedItems(QList<ProjectItem*> selected);
53
54
55 protected:
56 bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
57
58 private:
59 ProjectItemModel * baseModel;
60 QList<QModelIndex> selectedIndices;
61 QList<int> selectedIndexRows;
62 QPersistentModelIndex m_root;
63 QModelIndex root;
64
65
66 };
67
68};
69
70
71#endif
Provides access to data stored in a Project through Qt's model-view framework.
Definition ProjectItemModel.h:132
Definition SortFilterProxyModel.h:38
void setSelectedItems(QList< ProjectItem * > selected)
Definition SortFilterProxyModel.cpp:22
SortFilterProxyModel(QObject *parent=0)
Definition SortFilterProxyModel.cpp:17
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override
Definition SortFilterProxyModel.cpp:67
void setSourceModel(ProjectItemModel *newSourceModel)
Definition SortFilterProxyModel.cpp:38
bool setRoot(const QStandardItem *item)
Definition SortFilterProxyModel.cpp:58
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16