#include <Libs/MRML/Widgets/qMRMLSortFilterProxyModel.h>
|
QScopedPointer< qMRMLSortFilterProxyModelPrivate > | d_ptr |
|
Filter nodes based on their types and attributes Support filtering QSortFilterProxyModel::filterRegExp
Definition at line 43 of file qMRMLSortFilterProxyModel.h.
◆ Superclass
◆ AcceptType
This enum type is used to describe the behavior of a node with regard to filtering:
- Reject if the node should not be visible and has no chance of being visible.
- Accept if the node should be visible and will always be.
- RejectButPotentiallyAcceptable if the node should not be visible but has the potential for being visible. This can happen if a property is changed. The node should be observed by the model and invalidate the filter when modified to make sure its visibility state is correct.
- AcceptButPotentiallyRejectable if the node should be visible but has the potential for being hidden. See RejectButPotentiallyAcceptable.
Enumerator |
---|
Reject | |
Accept | |
RejectButPotentiallyAcceptable | |
AcceptButPotentiallyRejectable | |
Definition at line 247 of file qMRMLSortFilterProxyModel.h.
◆ FilterType
◆ filterType
◆ hiddenNodeIDs
QStringList qMRMLSortFilterProxyModel::hiddenNodeIDs |
|
readwrite |
◆ hideAll
bool qMRMLSortFilterProxyModel::hideAll |
|
readwrite |
This property controls whether all the nodes are hidden or not, bypassing any filter. False by default.
Definition at line 94 of file qMRMLSortFilterProxyModel.h.
◆ hideChildNodeTypes
QStringList qMRMLSortFilterProxyModel::hideChildNodeTypes |
|
readwrite |
◆ hideNodesUnaffiliatedWithNodeID
QString qMRMLSortFilterProxyModel::hideNodesUnaffiliatedWithNodeID |
|
readwrite |
This property controls whether nodes unaffiliated with a given node ID are hidden or not. All the nodes are visible (empty string) by default.
Definition at line 111 of file qMRMLSortFilterProxyModel.h.
◆ nodeTypes
QStringList qMRMLSortFilterProxyModel::nodeTypes |
|
readwrite |
This property controls which node is visible. The node class name must be provided. An empty list means all the nodes are visible (default).
Definition at line 51 of file qMRMLSortFilterProxyModel.h.
◆ showAll
bool qMRMLSortFilterProxyModel::showAll |
|
readwrite |
◆ showChildNodeTypes
bool qMRMLSortFilterProxyModel::showChildNodeTypes |
|
readwrite |
◆ showHidden
bool qMRMLSortFilterProxyModel::showHidden |
|
readwrite |
◆ showHiddenForTypes
QStringList qMRMLSortFilterProxyModel::showHiddenForTypes |
|
readwrite |
◆ visibleNodeIDs
QStringList qMRMLSortFilterProxyModel::visibleNodeIDs |
|
readwrite |
◆ qMRMLSortFilterProxyModel()
qMRMLSortFilterProxyModel::qMRMLSortFilterProxyModel |
( |
QObject * |
parent = nullptr | ) |
|
◆ ~qMRMLSortFilterProxyModel()
qMRMLSortFilterProxyModel::~qMRMLSortFilterProxyModel |
( |
| ) |
|
|
override |
◆ addAttribute()
Q_INVOKABLE void qMRMLSortFilterProxyModel::addAttribute |
( |
const QString & |
nodeType, |
|
|
const QString & |
attributeName, |
|
|
const QVariant & |
attributeValue = QVariant() |
|
) |
| |
Add node type attribute that filter the nodes to display. The default of a null QVariant means that any non null attributeValue will match
◆ attributeFilter()
Q_INVOKABLE QVariant qMRMLSortFilterProxyModel::attributeFilter |
( |
const QString & |
nodeType, |
|
|
const QString & |
attributeName |
|
) |
| const |
◆ filterAcceptsNode()
This method returns whether the node should be visible or hidden from the view. It returns the behavior of the node with regard to the filters.
- See also
- filterAcceptRow(), AcceptType
Reimplemented in qMRMLSortFilterHierarchyProxyModel.
◆ filterAcceptsRow()
bool qMRMLSortFilterProxyModel::filterAcceptsRow |
( |
int |
source_row, |
|
|
const QModelIndex & |
source_parent |
|
) |
| const |
|
overrideprotected |
Returns true if the item in the row indicated by the given source_row and source_parent should be included in the model; otherwise returns false. This method test each node via filterAcceptsNode and observe the nodes that have a potential for having their visibility changed. This method is final, it is not meant to be overwritten. If for some reason a node has not been observed but its visibility has changed, the filter can be refresh by calling a\ invalidate()
- See also
- filterAcceptsNode(), AcceptType, invalidate()
◆ filterType()
FilterType qMRMLSortFilterProxyModel::filterType |
( |
| ) |
const |
◆ hiddenNodeIDs()
QStringList qMRMLSortFilterProxyModel::hiddenNodeIDs |
( |
| ) |
const |
◆ hideAll()
bool qMRMLSortFilterProxyModel::hideAll |
( |
| ) |
const |
◆ hideChildNodeTypes()
QStringList qMRMLSortFilterProxyModel::hideChildNodeTypes |
( |
| ) |
const |
◆ hideNodesUnaffiliatedWithNodeID()
QString qMRMLSortFilterProxyModel::hideNodesUnaffiliatedWithNodeID |
( |
| ) |
const |
◆ indexFromMRMLNode()
Q_INVOKABLE QModelIndex qMRMLSortFilterProxyModel::indexFromMRMLNode |
( |
vtkMRMLNode * |
node, |
|
|
int |
column = 0 |
|
) |
| const |
◆ mrmlNodeFromIndex()
Q_INVOKABLE vtkMRMLNode* qMRMLSortFilterProxyModel::mrmlNodeFromIndex |
( |
const QModelIndex & |
index | ) |
const |
◆ mrmlScene()
vtkMRMLScene* qMRMLSortFilterProxyModel::mrmlScene |
( |
| ) |
const |
Retrieve the associated MRML scene.
◆ mrmlSceneIndex()
Q_INVOKABLE QModelIndex qMRMLSortFilterProxyModel::mrmlSceneIndex |
( |
| ) |
const |
Retrieve the MRML scene index.
◆ nodeTypes()
QStringList qMRMLSortFilterProxyModel::nodeTypes |
( |
| ) |
const |
◆ removeAttribute()
Q_INVOKABLE void qMRMLSortFilterProxyModel::removeAttribute |
( |
const QString & |
nodeType, |
|
|
const QString & |
attributeName |
|
) |
| |
Remove node type attribute filtering the displayed nodes
- See also
- addAttribute
◆ sceneModel()
Q_INVOKABLE qMRMLSceneModel* qMRMLSortFilterProxyModel::sceneModel |
( |
| ) |
const |
Return the scene model used as input if any.
◆ setFilterType
void qMRMLSortFilterProxyModel::setFilterType |
( |
FilterType |
filterType | ) |
|
|
slot |
◆ setHiddenNodeIDs()
void qMRMLSortFilterProxyModel::setHiddenNodeIDs |
( |
const QStringList & |
nodeIDsToHide | ) |
|
◆ setHideAll
void qMRMLSortFilterProxyModel::setHideAll |
( |
bool |
hide | ) |
|
|
slot |
◆ setHideChildNodeTypes()
void qMRMLSortFilterProxyModel::setHideChildNodeTypes |
( |
const QStringList & |
nodeTypes | ) |
|
If a node is a nodeType, hide the node if it is also a ExcludedChildNodeType. (this can happen if nodeType is a mother class of ExcludedChildNodeType)
- See also
- hideChildNodeTypes, hideChildNodeTypes()
◆ setHideNodesUnaffiliatedWithNodeID()
void qMRMLSortFilterProxyModel::setHideNodesUnaffiliatedWithNodeID |
( |
const QString & |
nodeID | ) |
|
◆ setNodeTypes()
void qMRMLSortFilterProxyModel::setNodeTypes |
( |
const QStringList & |
nodeTypes | ) |
|
◆ setShowAll
void qMRMLSortFilterProxyModel::setShowAll |
( |
bool |
show | ) |
|
|
slot |
◆ setShowChildNodeTypes()
void qMRMLSortFilterProxyModel::setShowChildNodeTypes |
( |
bool |
show | ) |
|
Display or not the nodes that are excluded by the ExcludedChildNodeTypes list. true by default.
◆ setShowHidden
void qMRMLSortFilterProxyModel::setShowHidden |
( |
bool |
| ) |
|
|
slot |
◆ setShowHiddenForTypes()
void qMRMLSortFilterProxyModel::setShowHiddenForTypes |
( |
const QStringList & |
nodeTypes | ) |
|
◆ setVisibleNodeIDs()
void qMRMLSortFilterProxyModel::setVisibleNodeIDs |
( |
const QStringList & |
nodeIDsToShow | ) |
|
◆ showAll()
bool qMRMLSortFilterProxyModel::showAll |
( |
| ) |
const |
◆ showChildNodeTypes()
bool qMRMLSortFilterProxyModel::showChildNodeTypes |
( |
| ) |
const |
◆ showHidden()
bool qMRMLSortFilterProxyModel::showHidden |
( |
| ) |
const |
◆ showHiddenForTypes()
QStringList qMRMLSortFilterProxyModel::showHiddenForTypes |
( |
| ) |
const |
Give more control over the types of MRML node you want to force the display even if their HideFromEditors property is true. Don't do anything if the list is empty.
- See also
- setShowHiddenForTypes, showHiddenForTypes
◆ sourceItem()
QStandardItem* qMRMLSortFilterProxyModel::sourceItem |
( |
const QModelIndex & |
index | ) |
const |
|
protected |
◆ visibleNodeIDs()
QStringList qMRMLSortFilterProxyModel::visibleNodeIDs |
( |
| ) |
const |
◆ d_ptr
QScopedPointer<qMRMLSortFilterProxyModelPrivate> qMRMLSortFilterProxyModel::d_ptr |
|
protected |
The documentation for this class was generated from the following file: