Isis Developer Reference
SubTreeProxyModel.h
Go to the documentation of this file.
1
2#ifndef SubTreeProxyModel_h
3#define SubTreeProxyModel_h
4
5#include <QIdentityProxyModel>
6#include <QPersistentModelIndex>
7#include <QSortFilterProxyModel>
8
9class QAbstractProxyModel;
10class QObject;
11class QStandardItem;
12class QVariant;
13
14namespace Isis {
15
25 Q_OBJECT
26
27 public:
28 explicit SubTreeProxyModel(QObject *parent = 0);
29
30 QModelIndex mapFromSource(const QModelIndex &sourceIndex) const Q_DECL_OVERRIDE;
31 QModelIndex mapToSource(const QModelIndex &proxyIndex) const Q_DECL_OVERRIDE;
32
33 void setSourceModel(QAbstractItemModel *newSourceModel) Q_DECL_OVERRIDE;
34
35 bool setRoot(const QStandardItem *item);
36
37
38 // Allow reading of the model
39 //QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
40 //Qt::ItemFlags flags(const QModelIndex &index) const override;
41
42 // Allow re-sizing the model
43 //bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
44
45 // Use the method below to change how filtering chooses to accept the row
46 // protected:
47 // bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
48
49 private:
50 QPersistentModelIndex m_root;
51
52 };
53
54};
55
56
57#endif
Definition SubTreeProxyModel.h:24
bool setRoot(const QStandardItem *item)
Definition SubTreeProxyModel.cpp:85
QModelIndex mapToSource(const QModelIndex &proxyIndex) const Q_DECL_OVERRIDE
Definition SubTreeProxyModel.cpp:66
QModelIndex mapFromSource(const QModelIndex &sourceIndex) const Q_DECL_OVERRIDE
Definition SubTreeProxyModel.cpp:36
void setSourceModel(QAbstractItemModel *newSourceModel) Q_DECL_OVERRIDE
Definition SubTreeProxyModel.cpp:71
SubTreeProxyModel(QObject *parent=0)
Constructs a SubTreeProxyModel.
Definition SubTreeProxyModel.cpp:30
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16