# Slicer 5.10 qMRMLSubjectHierarchyComboBox turned to 'None' but no issue with 5.8.1

**URL:** <https://discourse.slicer.org/t/slicer-5-10-qmrmlsubjecthierarchycombobox-turned-to-none-but-no-issue-with-5-8-1/45203>\
**Category:** Support\
**Tags:** bug, python, gui, parameternodewrapper\
**Created:** [November 24, 2025, 5:53am UTC](https://discourse.slicer.org/t/slicer-5-10-qmrmlsubjecthierarchycombobox-turned-to-none-but-no-issue-with-5-8-1/45203 "2025-11-24T05:53:33Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![chz31](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chz31/32/77363_2.png) [@chz31](https://discourse.slicer.org/u/chz31)\
**Post date:** [December 22, 2025, 5:34pm UTC](https://discourse.slicer.org/t/slicer-5-10-qmrmlsubjecthierarchycombobox-turned-to-none-but-no-issue-with-5-8-1/45203/5 "2025-12-22T17:34:38Z")

</div>

Sorry for the late response. Thank you very much for your advice and time!

Yes. Initially, I could not repeat the same bug directly in the Python console but only in an extension. After some tests, the snippet finally worked and could repeat the same issue:

To run with the snippet below, in a **fresh Slicer 5.10 scene** ,

1. Create a markup fiducial node
2. Copy-paste the below snippet in the Python console,
3. In the pop-up GUI, select the node in the combo box, and click the button below it.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/8/18969db1e0c28a7944d6cd266ee2aeed03a25aec.png)

#Copy-paste below snippet in the Python console:

```auto
import slicer, qt
from slicer.parameterNodeWrapper import parameterNodeWrapper

@parameterNodeWrapper
class SHTestParameters:
    selectedFiducial: slicer.vtkMRMLMarkupsFiducialNode

dialog = qt.QDialog(slicer.util.mainWindow())
dialog.setWindowTitle("SHComboBox move -> GUI reset -> Param wipe test")
layout = qt.QVBoxLayout(dialog)

shComboBox = slicer.qMRMLSubjectHierarchyComboBox()
shComboBox.nodeTypes = ["vtkMRMLMarkupsFiducialNode"]
shComboBox.noneEnabled = True
shComboBox.setMRMLScene(slicer.mrmlScene)

layout.addWidget(qt.QLabel("Select a fiducial (SubjectHierarchyComboBox):"))
layout.addWidget(shComboBox)

runButton = qt.QPushButton("Move selected node into folder (triggers reset)")
layout.addWidget(runButton)

parameterNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLScriptedModuleNode", "SHCombo_ParamNode_Test")
parameter = SHTestParameters(parameterNode)

shNode = slicer.vtkMRMLSubjectHierarchyNode.GetSubjectHierarchyNode(slicer.mrmlScene)

def printState(tag):
    print(f"\n[{tag}]")
    print(" shComboBox.currentItem():", shComboBox.currentItem())
    print(" shComboBox.currentNode():", shComboBox.currentNode())
    print(" parameter.selectedFiducial:", parameter.selectedFiducial)

# sync combo box to the parameter node similar to the original module
def onComboChanged(itemId):
    node = shNode.GetItemDataNode(itemId)
    parameter.selectedFiducial = node
    printState("Combo changed (GUI->param sync fired)")

shComboBox.connect("currentItemChanged(vtkIdType)", onComboChanged)

#Add the parameter node to a folder
def onRun():
    currentItemID = shComboBox.currentItem()
    if currentItemID == 0:
        print("No selection (currentItemID==0)")
        return

    # seed parameter node explicitly (like your "store orbitLm/plateLm first")
    parameter.selectedFiducial = shNode.GetItemDataNode(currentItemID)

    printState("BEFORE MOVE")

    folderItemID = shNode.CreateFolderItem(shNode.GetSceneItemID(), "SHCombo_TestFolder")
    shNode.SetItemParent(currentItemID, folderItemID)

    printState("AFTER MOVE (post SetItemParent)")

runButton.connect("clicked()", onRun)

dialog.show()
dialog.raise_()
dialog.activateWindow()

```

You should see that the node is put under a newly created folder, but the comboBox is reset to ‘None’

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/3/23c40b0573f27914f6b5dde26aeaba1673959fd6.png)

In Python console, you should see parameter node set to None because the parameter node is synced with the combobox by `def onComboChanged` the as in the original module:

```auto
[AFTER MOVE (post SetItemParent)]
shComboBox.currentItem(): 0
shComboBox.currentNode(): None
parameter.selectedFiducial: None

```

Interestingly, in the same scene, when I simply ran the same function again, the combobox did not set to ‘None’ afterwards. The error only happened when run the function first time in a fresh Slicer scene.

Let me know if this one works.

---

_[View the full topic](https://discourse.slicer.org/t/slicer-5-10-qmrmlsubjecthierarchycombobox-turned-to-none-but-no-issue-with-5-8-1/45203)._
