21 #ifndef __qMRMLSortFilterProxyModel_h 22 #define __qMRMLSortFilterProxyModel_h 25 #include <QSortFilterProxyModel> 26 #include <QStringList> 30 #include <ctkVTKObject.h> 33 #include "qMRMLWidgetsExport.h" 37 class qMRMLAbstractItemHelper;
39 class qMRMLSortFilterProxyModelPrivate;
51 Q_PROPERTY(QStringList nodeTypes READ nodeTypes WRITE setNodeTypes)
54 Q_PROPERTY(
bool showHidden READ showHidden WRITE setShowHidden)
60 Q_PROPERTY(QStringList showHiddenForTypes READ showHiddenForTypes WRITE setShowHiddenForTypes)
65 Q_PROPERTY(
bool showChildNodeTypes READ showChildNodeTypes WRITE setShowChildNodeTypes)
71 Q_PROPERTY(QStringList hideChildNodeTypes READ hideChildNodeTypes WRITE setHideChildNodeTypes)
81 Q_PROPERTY(
FilterType filterType READ filterType WRITE setFilterType)
90 Q_PROPERTY(
bool showAll READ showAll WRITE setShowAll STORED false)
94 Q_PROPERTY(
bool hideAll READ hideAll WRITE setHideAll STORED false)
100 Q_PROPERTY(QStringList hiddenNodeIDs READ hiddenNodeIDs WRITE setHiddenNodeIDs)
106 Q_PROPERTY(QStringList visibleNodeIDs READ visibleNodeIDs WRITE setVisibleNodeIDs)
111 Q_PROPERTY(QString hideNodesUnaffiliatedWithNodeID READ hideNodesUnaffiliatedWithNodeID WRITE setHideNodesUnaffiliatedWithNodeID)
129 Q_INVOKABLE QModelIndex mrmlSceneIndex()
const;
132 Q_INVOKABLE
vtkMRMLNode* mrmlNodeFromIndex(
const QModelIndex& index)
const;
135 Q_INVOKABLE QModelIndex indexFromMRMLNode(
vtkMRMLNode* node,
int column = 0)
const;
140 QStringList nodeTypes()
const;
141 void setNodeTypes(
const QStringList& nodeTypes);
146 bool showHidden()
const;
152 QStringList showHiddenForTypes()
const;
153 void setShowHiddenForTypes(
const QStringList& nodeTypes);
158 Q_INVOKABLE
void addAttribute(
const QString& nodeType,
159 const QString& attributeName,
160 const QVariant& attributeValue = QVariant());
163 Q_INVOKABLE
void removeAttribute(
const QString& nodeType,
const QString& attributeName);
167 Q_INVOKABLE QVariant attributeFilter(
168 const QString& nodeType,
const QString& attributeName)
const;
173 void setShowChildNodeTypes(
bool show);
174 bool showChildNodeTypes()
const;
180 void setHideChildNodeTypes(
const QStringList& nodeTypes);
182 QStringList hideChildNodeTypes()
const;
186 void setHiddenNodeIDs(
const QStringList& nodeIDsToHide);
189 QStringList hiddenNodeIDs()
const;
193 void setVisibleNodeIDs(
const QStringList& nodeIDsToShow);
196 QStringList visibleNodeIDs()
const;
201 void setHideNodesUnaffiliatedWithNodeID(
const QString& nodeID);
204 QString hideNodesUnaffiliatedWithNodeID()
const;
222 void setShowHidden(
bool);
229 void setShowAll(
bool show);
232 void setHideAll(
bool hide);
262 virtual bool filterAcceptsRow(
int source_row,
263 const QModelIndex &source_parent)
const;
270 QStandardItem* sourceItem(
const QModelIndex& index)
const;
273 QScopedPointer<qMRMLSortFilterProxyModelPrivate>
d_ptr;
QSortFilterProxyModel Superclass
QScopedPointer< qMRMLSortFilterProxyModelPrivate > d_ptr
A set of MRML Nodes that supports serialization and undo/redo.
Abstract Superclass for all specific types of MRML nodes.