23 #ifndef __qMRMLSortFilterSubjectHierarchyProxyModel_h 24 #define __qMRMLSortFilterSubjectHierarchyProxyModel_h 27 #include "qSlicerSubjectHierarchyModuleWidgetsExport.h" 30 #include <QSortFilterProxyModel> 33 #include <ctkVTKObject.h> 36 class qMRMLSortFilterSubjectHierarchyProxyModelPrivate;
48 Q_PROPERTY(QString nameFilter READ nameFilter WRITE setNameFilter)
51 Q_PROPERTY(vtkIdType hideItemsUnaffiliatedWithItemID READ hideItemsUnaffiliatedWithItemID WRITE setHideItemsUnaffiliatedWithItemID)
56 Q_PROPERTY(
bool showEmptyHierarchyItems READ showEmptyHierarchyItems WRITE setShowEmptyHierarchyItems)
58 Q_PROPERTY(QStringList levelFilter READ levelFilter WRITE setLevelFilter)
62 Q_PROPERTY(QStringList nodeTypes READ nodeTypes WRITE setNodeTypes)
71 Q_PROPERTY(QStringList hideChildNodeTypes READ hideChildNodeTypes WRITE setHideChildNodeTypes)
75 Q_PROPERTY(QStringList includeItemAttributeNamesFilter READ includeItemAttributeNamesFilter WRITE setIncludeItemAttributeNamesFilter)
78 Q_PROPERTY(QStringList includeNodeAttributeNamesFilter READ includeNodeAttributeNamesFilter WRITE setIncludeNodeAttributeNamesFilter)
82 Q_PROPERTY(QStringList excludeItemAttributeNamesFilter READ excludeItemAttributeNamesFilter WRITE setExcludeItemAttributeNamesFilter)
86 Q_PROPERTY(QStringList excludeNodeAttributeNamesFilter READ excludeNodeAttributeNamesFilter WRITE setExcludeNodeAttributeNamesFilter)
90 Q_PROPERTY(QString attributeNameFilter READ attributeNameFilter WRITE setAttributeNameFilter)
95 Q_PROPERTY(QString attributeValueFilter READ attributeValueFilter WRITE setAttributeValueFilter)
105 QString nameFilter()const;
106 QStringList levelFilter()const;
107 QStringList nodeTypes()const;
108 QStringList hideChildNodeTypes()const;
109 QStringList includeItemAttributeNamesFilter()const;
110 QStringList includeNodeAttributeNamesFilter()const;
111 QStringList excludeItemAttributeNamesFilter()const;
112 QStringList excludeNodeAttributeNamesFilter()const;
113 QString attributeValueFilter()const;
114 QString attributeNameFilter()const;
122 Q_INVOKABLE
void addItemAttributeFilter(QString attributeName, QVariant attributeValue=QString(),
bool include=true);
124 Q_INVOKABLE
void removeItemAttributeFilter(QString attributeName, QVariant attributeValue,
bool include);
126 Q_INVOKABLE
void removeItemAttributeFilter(QString attributeName,
bool include);
135 Q_INVOKABLE
void addNodeAttributeFilter(QString attributeName, QVariant attributeValue=QString(),
bool include=true, QString className=QString());
137 Q_INVOKABLE
void removeNodeAttributeFilter(QString attributeName, QVariant attributeValue,
bool include, QString className);
139 Q_INVOKABLE
void removeNodeAttributeFilter(QString attributeName,
bool include);
141 vtkIdType hideItemsUnaffiliatedWithItemID()const;
142 void setHideItemsUnaffiliatedWithItemID(vtkIdType itemID);
144 bool showEmptyHierarchyItems()const;
145 void setShowEmptyHierarchyItems(
bool show);
148 Q_INVOKABLE QModelIndex subjectHierarchySceneIndex()const;
151 Q_INVOKABLE vtkIdType subjectHierarchyItemFromIndex(const QModelIndex& index)const;
154 Q_INVOKABLE QModelIndex indexFromSubjectHierarchyItem(vtkIdType itemID,
int column=0)const;
159 Q_INVOKABLE
int acceptedItemCount(vtkIdType rootItemID=0)const;
164 bool filterAcceptsRow(
int sourceRow, const QModelIndex &sourceParent)const override;
166 Qt::ItemFlags flags(const QModelIndex & index)const override;
169 void setNameFilter(QString filter);
170 void setAttributeNameFilter(QString filter);
171 void setAttributeValueFilter(QString filter);
172 void setLevelFilter(QStringList filter);
173 void setNodeTypes(const QStringList& types);
174 void setHideChildNodeTypes(const QStringList& types);
175 void setIncludeItemAttributeNamesFilter(QStringList filterList);
176 void setIncludeNodeAttributeNamesFilter(QStringList filterList);
177 void setExcludeItemAttributeNamesFilter(QStringList filterList);
178 void setExcludeNodeAttributeNamesFilter(QStringList filterList);
197 virtual AcceptType filterAcceptsItem(vtkIdType itemID,
bool canAcceptIfAnyChildIsAccepted=
true)
const;
199 QStandardItem* sourceItem(
const QModelIndex& index)
const;
202 QScopedPointer<qMRMLSortFilterSubjectHierarchyProxyModelPrivate>
d_ptr;
MRML node to represent a complete subject hierarchy tree.
A set of MRML Nodes that supports serialization and undo/redo.
QScopedPointer< qMRMLSortFilterSubjectHierarchyProxyModelPrivate > d_ptr
QSortFilterProxyModel Superclass