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)
53 Q_PROPERTY(QStringList levelFilter READ levelFilter WRITE setLevelFilter)
56 Q_PROPERTY(QStringList nodeTypes READ nodeTypes WRITE setNodeTypes)
65 Q_PROPERTY(QStringList hideChildNodeTypes READ hideChildNodeTypes WRITE setHideChildNodeTypes)
69 Q_PROPERTY(QStringList includeItemAttributeNamesFilter READ includeItemAttributeNamesFilter WRITE setIncludeItemAttributeNamesFilter)
72 Q_PROPERTY(QStringList includeNodeAttributeNamesFilter READ includeNodeAttributeNamesFilter WRITE setIncludeNodeAttributeNamesFilter)
76 Q_PROPERTY(QStringList excludeItemAttributeNamesFilter READ excludeItemAttributeNamesFilter WRITE setExcludeItemAttributeNamesFilter)
80 Q_PROPERTY(QStringList excludeNodeAttributeNamesFilter READ excludeNodeAttributeNamesFilter WRITE setExcludeNodeAttributeNamesFilter)
84 Q_PROPERTY(QString attributeNameFilter READ attributeNameFilter WRITE setAttributeNameFilter)
89 Q_PROPERTY(QString attributeValueFilter READ attributeValueFilter WRITE setAttributeValueFilter)
99 QString nameFilter()const;
100 QStringList levelFilter()const;
101 QStringList nodeTypes()const;
102 QStringList hideChildNodeTypes()const;
103 QStringList includeItemAttributeNamesFilter()const;
104 QStringList includeNodeAttributeNamesFilter()const;
105 QStringList excludeItemAttributeNamesFilter()const;
106 QStringList excludeNodeAttributeNamesFilter()const;
107 QString attributeValueFilter()const;
108 QString attributeNameFilter()const;
116 Q_INVOKABLE
void addItemAttributeFilter(QString attributeName, QVariant attributeValue=QString(),
bool include=true);
118 Q_INVOKABLE
void removeItemAttributeFilter(QString attributeName, QVariant attributeValue,
bool include);
120 Q_INVOKABLE
void removeItemAttributeFilter(QString attributeName,
bool include);
129 Q_INVOKABLE
void addNodeAttributeFilter(QString attributeName, QVariant attributeValue=QString(),
bool include=true, QString className=QString());
131 Q_INVOKABLE
void removeNodeAttributeFilter(QString attributeName, QVariant attributeValue,
bool include, QString className);
133 Q_INVOKABLE
void removeNodeAttributeFilter(QString attributeName,
bool include);
135 Q_INVOKABLE vtkIdType hideItemsUnaffiliatedWithItemID();
136 Q_INVOKABLE
void setHideItemsUnaffiliatedWithItemID(vtkIdType itemID);
139 Q_INVOKABLE QModelIndex subjectHierarchySceneIndex()const;
142 Q_INVOKABLE vtkIdType subjectHierarchyItemFromIndex(const QModelIndex& index)const;
145 Q_INVOKABLE QModelIndex indexFromSubjectHierarchyItem(vtkIdType itemID,
int column=0)const;
150 Q_INVOKABLE
int acceptedItemCount(vtkIdType rootItemID=0)const;
155 bool filterAcceptsRow(
int sourceRow, const QModelIndex &sourceParent)const override;
158 virtual
bool filterAcceptsItem(vtkIdType itemID,
bool canAcceptIfAnyChildIsAccepted=true)const;
160 Qt::ItemFlags flags(const QModelIndex & index)const override;
163 void setNameFilter(QString filter);
164 void setAttributeNameFilter(QString filter);
165 void setAttributeValueFilter(QString filter);
166 void setLevelFilter(QStringList filter);
167 void setNodeTypes(const QStringList& types);
168 void setHideChildNodeTypes(const QStringList& types);
169 void setIncludeItemAttributeNamesFilter(QStringList filterList);
170 void setIncludeNodeAttributeNamesFilter(QStringList filterList);
171 void setExcludeItemAttributeNamesFilter(QStringList filterList);
172 void setExcludeNodeAttributeNamesFilter(QStringList filterList);
176 QStandardItem* sourceItem(const QModelIndex& index)const;
179 QScopedPointer<qMRMLSortFilterSubjectHierarchyProxyModelPrivate> d_ptr;
MRML node to represent a complete subject hierarchy tree.
A set of MRML Nodes that supports serialization and undo/redo.
QSortFilterProxyModel Superclass