# Adding nodes in qMRMLSubjectHierarchyTreeView

**URL:** <https://discourse.slicer.org/t/adding-nodes-in-qmrmlsubjecthierarchytreeview/43993>\
**Category:** Development\
**Tags:** subject-hierarchy\
**Created:** [August 7, 2025, 7:49am UTC](https://discourse.slicer.org/t/adding-nodes-in-qmrmlsubjecthierarchytreeview/43993 "2025-08-07T07:49:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Victor\_Wayne](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/victor_wayne/32/80778_2.png) [@Victor\_Wayne](https://discourse.slicer.org/u/Victor_Wayne)\
**Post date:** [August 7, 2025, 7:49am UTC](https://discourse.slicer.org/t/adding-nodes-in-qmrmlsubjecthierarchytreeview/43993/1 "2025-08-07T07:49:24Z")

</div>

Hello,

I am tracking some line nodes of type `vtkMRMLMarkupsLineNode` in a class called Plan for specific plan created by the user. How can I add those lines to the qMRMLSubjectHierarchyTreeView that I created in my custom widget?

if I set nodeType = [‘vtkMRMLMarkupsLineNode’] it correctly shows the lines only but it also shows the folder. How can I get rid of the folders if I can’t add a node to the tree view?

One last thing, How can I remove a specific node from the tree view but not from the scene?

Any help will be appreciated and thanks for your precious time.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [August 7, 2025, 12:28pm UTC](https://discourse.slicer.org/t/adding-nodes-in-qmrmlsubjecthierarchytreeview/43993/2 "2025-08-07T12:28:23Z")

</div>

This question seems to be more or less a duplicate of this:

> [@How to add folder in scene?](https://discourse.slicer.org/t/how-to-add-folder-in-scene/29499/16):
>
> I have to admit that I don’t quite get what you are saying. Here’s what I want to do. I inspected the Data module and found out that it is using qMRMLSubjectHierarchyTreeView widget for showing the nodes in a tree view. I wanted to customize the Data module by creating my own custom widget. So I created a widget, with a combo box that selects from the list plans. The plans contains lines. I want to show the lines like a list and with all the added functionality of hide/show `eye` button, trans…
