Isis 3 Programmer Reference
SubTreeProxyModel.h
1
2
#ifndef SubTreeProxyModel_h
3
#define SubTreeProxyModel_h
4
5
#include <QIdentityProxyModel>
6
#include <QPersistentModelIndex>
7
#include <QSortFilterProxyModel>
8
9
class
QAbstractProxyModel;
10
class
QObject
;
11
class
QStandardItem
;
12
class
QVariant;
13
14
namespace
Isis
{
15
24
class
SubTreeProxyModel
:
public
QIdentityProxyModel
{
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
Isis::SubTreeProxyModel
Definition
SubTreeProxyModel.h:24
Isis::SubTreeProxyModel::SubTreeProxyModel
SubTreeProxyModel(QObject *parent=0)
Constructs a SubTreeProxyModel.
Definition
SubTreeProxyModel.cpp:30
QIdentityProxyModel
QObject
QStandardItem
Isis
This is free and unencumbered software released into the public domain.
Definition
Apollo.h:16
src
qisis
objs
SubTreeProxyModel
SubTreeProxyModel.h