# qMRMLSubjectHierarchyComboBox as parameter node

**URL:** <https://discourse.slicer.org/t/qmrmlsubjecthierarchycombobox-as-parameter-node/43711>\
**Category:** Support\
**Created:** [July 14, 2025, 2:53pm UTC](https://discourse.slicer.org/t/qmrmlsubjecthierarchycombobox-as-parameter-node/43711 "2025-07-14T14:53:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amy\_Morton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/amy_morton/32/67318_2.png) [@Amy\_Morton](https://discourse.slicer.org/u/Amy_Morton)\
**Post date:** [July 14, 2025, 2:53pm UTC](https://discourse.slicer.org/t/qmrmlsubjecthierarchycombobox-as-parameter-node/43711/1 "2025-07-14T14:53:29Z")

</div>

I’d like to programmatically assign a subject hierarchy group to a qMRMLSubjectHierarchyComboBox in my module. After setting SlicerParameterName property to hNode, in designer I add hNode to my parameterNodeWrapper

```auto
hNode: vtkMRMLSubjectHierarchyNode

```

with appropriate import.

However… at module reload:

```auto
RuntimeError: Unable to create GUI connector from datatype '<class 'MRMLCorePython.vtkMRMLSubjectHierarchyNode'>' to widget type '<class 'PythonQt.qSlicerSubjectHierarchyModuleWidgets.qMRMLSubjectHierarchyComboBox'>'. To determine which data types can be connected to which widget types, please check 'canRepresent' methods in 'GuiConnector' classes in these files: C:\Users\amorton1\AppData\Local\slicer.org\Slicer 5.8.1\lib\Slicer-5.8\qt-scripted-modules\SubjectHierarchyLib\parameterNodeWrapper\guiConnectors.py,

```

Which indicates

```auto
 def canRepresent(widget, datatype) -> bool:
        return type(widget) == qMRMLSubjectHierarchyTreeView and isNodeOrUnionOfNodes(datatype)

```

I’m a bit stuck

Is there an appropriate data type I can assign to hNode in my parameterNodeWrapper ?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 15, 2025, 3:19am UTC](https://discourse.slicer.org/t/qmrmlsubjecthierarchycombobox-as-parameter-node/43711/2 "2025-07-15T03:19:46Z")

</div>

GUI connectors are not implemented for some less-frequently used widgets. I’ve added a GUI connector for this that can connect a MRML node to the subject hierarchy combobox:

> <https://github.com/Slicer/Slicer/pull/8573>
>
> Parameter node wrapper GUI connector was not implemented for many widgets (#7308…), including qMRMLSubjectHierarchyComboBox. This commit adds a connector that can read/write qMRMLSubjectHierarchyComboBox as a MRML node.
> 
> fixes #7905

It would be great if you could test it.

---

<div class="post-metadata">

**Author:** ![Amy\_Morton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/amy_morton/32/67318_2.png) [@Amy\_Morton](https://discourse.slicer.org/u/Amy_Morton)\
**Post date:** [July 15, 2025, 1:52pm UTC](https://discourse.slicer.org/t/qmrmlsubjecthierarchycombobox-as-parameter-node/43711/3 "2025-07-15T13:52:30Z")

</div>

Will do! Thank-you @lassoan !
