#include <Libs/MRML/Widgets/qMRMLTreeView.h>
|
static QModelIndex | findAncestor (const QModelIndex &index, const QModelIndexList &potentialAncestors) |
|
static bool | isAncestor (const QModelIndex &index, const QModelIndex &potentialAncestor) |
|
static QModelIndexList | removeChildren (const QModelIndexList &indexes) |
| Remove indexes that have at least one ancestor in the list. More...
|
|
|
QScopedPointer< qMRMLTreeViewPrivate > | d_ptr |
|
- Todo:
- Rename to qMRMLSceneTreeView In debug mode, pressing the '!' key on the view switches of qMRMLSortFilterProxyModel::filterType, it can be useful to debug the scene model and filters applied to them.
Definition at line 45 of file qMRMLTreeView.h.
◆ Superclass
◆ deleteMenuActionVisible
bool qMRMLTreeView::deleteMenuActionVisible |
|
readwrite |
◆ editMenuActionVisible
bool qMRMLTreeView::editMenuActionVisible |
|
readwrite |
◆ fitSizeToVisibleIndexes
bool qMRMLTreeView::fitSizeToVisibleIndexes |
|
readwrite |
This property controls whether the list auto resize to fit its size to show the number indexes without scrollbar.
Definition at line 78 of file qMRMLTreeView.h.
◆ listenNodeModifiedEvent
This property controls whether to actively listen to the nodes to synchronize their representation. As it can be time consuming, you can disable it if you want a lazy update. OnlyVisibleNodes by default.
- See also
- qMRMLSceneModel::listenNodeModifiedEvent
Definition at line 65 of file qMRMLTreeView.h.
◆ minSizeHint
QSize qMRMLTreeView::minSizeHint |
|
readwrite |
This property controls the minimum size of (minimum)sizeHint. When fitSizeToVisibleIndexes is true, the default size can be small if the contains few nodes. Setting minSizeHint ensures a minimum size of the tree minimumSizeHint and sizeHint properties.
- See also
- fitSizeToVisibleIndexes
Definition at line 84 of file qMRMLTreeView.h.
◆ nodeTypes
QStringList qMRMLTreeView::nodeTypes |
|
readwrite |
This property controls which node types are visible in the view. This behaves as a filter, the nodes that have a type not included in the list will be hidden. For example, a value of "vtkMRMLModelHierarchyNode", "vtkMRMLModelNode" will show the model nodes. When dealing with hierarchies, please note that the node type of the parents should not be filtered out (should be included in nodeTypes) to ensure the children are visible. All nodes are visible by default (QStringList()).
- See also
- qMRMLSortFilterProxyModel::nodeTypes
Definition at line 75 of file qMRMLTreeView.h.
◆ renameMenuActionVisible
bool qMRMLTreeView::renameMenuActionVisible |
|
readwrite |
◆ sceneModelType
QString qMRMLTreeView::sceneModelType |
|
readwrite |
This property controls what type of scene representation (which qMRMLSceneModel implementation/subclass)is used to populate the nodes of the scene. Some built-in model types are available :
Definition at line 59 of file qMRMLTreeView.h.
◆ showHidden
bool qMRMLTreeView::showHidden |
|
readwrite |
◆ showRootNode
bool qMRMLTreeView::showRootNode |
|
readwrite |
This property controls whether the root node if any is visible. When the root node is visible, it appears as a top-level item, if it is hidden only its children are top-level items. It doesn't have any effect if rootNode() is null. Hidden by default. Don't use qMRMLSortFilterProxyModel::HideNodesUnaffiliatedWithNodeID if showRootNode is true, it is internally being used.
- See also
- setShowRootNode(), showRootNode(), showScene, setRootNode(), setRootIndex()
Definition at line 117 of file qMRMLTreeView.h.
◆ showScene
bool qMRMLTreeView::showScene |
|
readwrite |
◆ qMRMLTreeView() [1/2]
qMRMLTreeView::qMRMLTreeView |
( |
QWidget * |
parent = 0 | ) |
|
◆ ~qMRMLTreeView()
virtual qMRMLTreeView::~qMRMLTreeView |
( |
| ) |
|
|
virtual |
◆ qMRMLTreeView() [2/2]
qMRMLTreeView::qMRMLTreeView |
( |
qMRMLTreeViewPrivate * |
pimpl, |
|
|
QWidget * |
parent = 0 |
|
) |
| |
|
protected |
◆ appendNodeMenuAction()
void qMRMLTreeView::appendNodeMenuAction |
( |
QAction * |
action | ) |
|
◆ appendSceneMenuAction()
void qMRMLTreeView::appendSceneMenuAction |
( |
QAction * |
action | ) |
|
◆ clickDecoration()
virtual bool qMRMLTreeView::clickDecoration |
( |
const QModelIndex & |
index | ) |
|
|
virtual |
◆ currentNode()
Return a pointer to the current node (not necessarily selected), 0 if no node is current
- See also
- QItemSelectionModel::currentIndex(), QItemSelectionModel::selectedIndexes()
◆ currentNodeChanged
void qMRMLTreeView::currentNodeChanged |
( |
vtkMRMLNode * |
node | ) |
|
|
signal |
◆ currentNodeDeleted
void qMRMLTreeView::currentNodeDeleted |
( |
const QModelIndex & |
index | ) |
|
|
signal |
◆ currentNodeRenamed
void qMRMLTreeView::currentNodeRenamed |
( |
const QString & |
newName | ) |
|
|
signal |
◆ decorationClicked
void qMRMLTreeView::decorationClicked |
( |
const QModelIndex & |
| ) |
|
|
signal |
◆ deleteCurrentNode
void qMRMLTreeView::deleteCurrentNode |
( |
| ) |
|
|
slot |
◆ editCurrentNode
void qMRMLTreeView::editCurrentNode |
( |
| ) |
|
|
slot |
◆ editNodeRequested
void qMRMLTreeView::editNodeRequested |
( |
vtkMRMLNode * |
node | ) |
|
|
signal |
◆ eventFilter()
virtual bool qMRMLTreeView::eventFilter |
( |
QObject * |
object, |
|
|
QEvent * |
e |
|
) |
| |
|
virtual |
◆ findAncestor()
static QModelIndex qMRMLTreeView::findAncestor |
( |
const QModelIndex & |
index, |
|
|
const QModelIndexList & |
potentialAncestors |
|
) |
| |
|
static |
Return an ancestor in the list of potential ancestors if any, otherwise return an invalid QModelIndex
◆ fitSizeToVisibleIndexes()
bool qMRMLTreeView::fitSizeToVisibleIndexes |
( |
| ) |
const |
◆ isAncestor()
static bool qMRMLTreeView::isAncestor |
( |
const QModelIndex & |
index, |
|
|
const QModelIndex & |
potentialAncestor |
|
) |
| |
|
static |
Return true if potentialAncestor is an ancestor of index
◆ isDeleteMenuActionVisible()
bool qMRMLTreeView::isDeleteMenuActionVisible |
( |
| ) |
const |
Show/Hide the "Delete" menu item on right context menu Visible by default
◆ isEditMenuActionVisible()
bool qMRMLTreeView::isEditMenuActionVisible |
( |
| ) |
const |
Show/Hide the "Edit properties..." menu item on right context menu Hidden by default
◆ isRenameMenuActionVisible()
bool qMRMLTreeView::isRenameMenuActionVisible |
( |
| ) |
const |
Show/Hide the "Rename" menu item on right context menu Visible by default
◆ keyPressEvent()
virtual void qMRMLTreeView::keyPressEvent |
( |
QKeyEvent * |
event | ) |
|
|
protectedvirtual |
◆ listenNodeModifiedEvent()
◆ loadTreeExpandState
void qMRMLTreeView::loadTreeExpandState |
( |
| ) |
|
|
protectedslot |
◆ minimumSizeHint()
virtual QSize qMRMLTreeView::minimumSizeHint |
( |
| ) |
const |
|
virtual |
◆ minSizeHint()
QSize qMRMLTreeView::minSizeHint |
( |
| ) |
const |
◆ mousePressEvent()
virtual void qMRMLTreeView::mousePressEvent |
( |
QMouseEvent * |
event | ) |
|
|
protectedvirtual |
◆ mouseReleaseEvent()
virtual void qMRMLTreeView::mouseReleaseEvent |
( |
QMouseEvent * |
event | ) |
|
|
protectedvirtual |
◆ mrmlScene()
◆ nodeTypes()
QStringList qMRMLTreeView::nodeTypes |
( |
| ) |
const |
◆ onNumberOfVisibleIndexChanged
void qMRMLTreeView::onNumberOfVisibleIndexChanged |
( |
| ) |
|
|
protectedslot |
◆ onSelectionChanged
virtual void qMRMLTreeView::onSelectionChanged |
( |
const QItemSelection & |
selected, |
|
|
const QItemSelection & |
deselected |
|
) |
| |
|
protectedvirtualslot |
◆ prependNodeMenuAction()
void qMRMLTreeView::prependNodeMenuAction |
( |
QAction * |
action | ) |
|
◆ prependSceneMenuAction()
void qMRMLTreeView::prependSceneMenuAction |
( |
QAction * |
action | ) |
|
◆ removeChildren()
static QModelIndexList qMRMLTreeView::removeChildren |
( |
const QModelIndexList & |
indexes | ) |
|
|
static |
Remove indexes that have at least one ancestor in the list.
◆ removeNodeMenuAction()
void qMRMLTreeView::removeNodeMenuAction |
( |
QAction * |
action | ) |
|
Remove action from the "NodeMenu".
◆ renameCurrentNode
void qMRMLTreeView::renameCurrentNode |
( |
| ) |
|
|
slot |
◆ rootNode()
◆ saveTreeExpandState
void qMRMLTreeView::saveTreeExpandState |
( |
| ) |
|
|
protectedslot |
◆ sceneModel()
◆ sceneModelType()
QString qMRMLTreeView::sceneModelType |
( |
| ) |
const |
◆ scrollTo
void qMRMLTreeView::scrollTo |
( |
const QString & |
displayName | ) |
|
|
slot |
Search the nodes matching displayName; if found, ensure a matching node is visible and current. If the current node matches displayName, then make sure it is visible (by scrolling and expanding as needed). If the current node does not match displayName, then make the first matching node current and visible. This slot can be connected as-is with a QLineEdit or a ctkSearchBox textChanged(QString) signal.
- See also
- scrollToNext()
◆ scrollToNext
void qMRMLTreeView::scrollToNext |
( |
| ) |
|
|
slot |
Repeat the last scrollTo() command, and if more than one node was matching select the next node. This slot can be connected as-is with a QLineEdit or a ctkSearchBox returnPressed() signal.
- See also
- scrollTo()
◆ setCurrentNode
void qMRMLTreeView::setCurrentNode |
( |
vtkMRMLNode * |
node | ) |
|
|
slot |
Change the current view node to node.
- See also
- currentNode
◆ setDeleteMenuActionVisible()
void qMRMLTreeView::setDeleteMenuActionVisible |
( |
bool |
show | ) |
|
◆ setDontHideAll
void qMRMLTreeView::setDontHideAll |
( |
bool |
dontHide | ) |
|
|
inlineslot |
◆ setEditMenuActionVisible()
void qMRMLTreeView::setEditMenuActionVisible |
( |
bool |
show | ) |
|
◆ setFitSizeToVisibleIndexes()
void qMRMLTreeView::setFitSizeToVisibleIndexes |
( |
bool |
| ) |
|
When true, the tree widget resize itself so that it's sizeHint is right for the visible indexes
◆ setHideAll
void qMRMLTreeView::setHideAll |
( |
bool |
hide | ) |
|
|
inlineslot |
◆ setListenNodeModifiedEvent()
◆ setMinSizeHint()
void qMRMLTreeView::setMinSizeHint |
( |
QSize |
min | ) |
|
◆ setMRMLScene
virtual void qMRMLTreeView::setMRMLScene |
( |
vtkMRMLScene * |
scene | ) |
|
|
virtualslot |
◆ setNodeTypes()
void qMRMLTreeView::setNodeTypes |
( |
const QStringList & |
nodeTypes | ) |
|
◆ setRenameMenuActionVisible()
void qMRMLTreeView::setRenameMenuActionVisible |
( |
bool |
show | ) |
|
◆ setRootNode
Similar to setRootIndex(QModelIndex) but observe the ModifiedEvent of the node to stay in sync. A null node (default) means QModelIndex() is the root index.
- See also
- rootNode(), setRootIndex(), showRootNode
◆ setSceneModel()
void qMRMLTreeView::setSceneModel |
( |
qMRMLSceneModel * |
newSceneModel, |
|
|
const QString & |
modelType |
|
) |
| |
◆ setSceneModelType
void qMRMLTreeView::setSceneModelType |
( |
const QString & |
modelType | ) |
|
|
slot |
If the modelType doesn't match any known model, nothing will happen
◆ setShowAll
void qMRMLTreeView::setShowAll |
( |
bool |
show | ) |
|
|
inlineslot |
◆ setShowHidden()
void qMRMLTreeView::setShowHidden |
( |
bool |
enable | ) |
|
|
inline |
If a vtkMRMLNode has the property HideFromEditors set to true, bypass the property and show the node anyway.
Definition at line 339 of file qMRMLTreeView.h.
◆ setShowRootNode()
void qMRMLTreeView::setShowRootNode |
( |
bool |
show | ) |
|
◆ setShowScene()
void qMRMLTreeView::setShowScene |
( |
bool |
show | ) |
|
◆ setSortFilterProxyModel()
Customize the filter model.
◆ showEvent()
virtual void qMRMLTreeView::showEvent |
( |
QShowEvent * |
show | ) |
|
|
virtual |
◆ showHidden()
bool qMRMLTreeView::showHidden |
( |
| ) |
const |
|
inline |
◆ showRootNode()
bool qMRMLTreeView::showRootNode |
( |
| ) |
const |
◆ showScene()
bool qMRMLTreeView::showScene |
( |
| ) |
const |
◆ sizeHint()
virtual QSize qMRMLTreeView::sizeHint |
( |
| ) |
const |
|
virtual |
◆ sortFilterProxyModel()
Retrieve the sortFilterProxyModel used to filter/sort the nodes. The returned value can't be null.
◆ toggleVisibility()
virtual void qMRMLTreeView::toggleVisibility |
( |
const QModelIndex & |
index | ) |
|
|
protectedvirtual |
◆ updateGeometries()
virtual void qMRMLTreeView::updateGeometries |
( |
| ) |
|
|
protectedvirtual |
◆ updateRootNode
void qMRMLTreeView::updateRootNode |
( |
vtkObject * |
modifiedRootNode | ) |
|
|
protectedslot |
◆ d_ptr
QScopedPointer<qMRMLTreeViewPrivate> qMRMLTreeView::d_ptr |
|
protected |
The documentation for this class was generated from the following file: