# Cannot get a second vtkMRMLNodeComboBox to show nodes

**URL:** <https://discourse.slicer.org/t/cannot-get-a-second-vtkmrmlnodecombobox-to-show-nodes/18204>\
**Category:** Development\
**Tags:** qt\
**Created:** [June 18, 2021, 12:58pm UTC](https://discourse.slicer.org/t/cannot-get-a-second-vtkmrmlnodecombobox-to-show-nodes/18204 "2021-06-18T12:58:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![atracsys-sbt](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/atracsys-sbt/32/11434_2.png) [@atracsys-sbt](https://discourse.slicer.org/u/atracsys-sbt)\
**Post date:** [June 18, 2021, 12:58pm UTC](https://discourse.slicer.org/t/cannot-get-a-second-vtkmrmlnodecombobox-to-show-nodes/18204/1 "2021-06-18T12:58:09Z")

</div>

Hi,  
I’m trying to develop a module in which I can choose model nodes as two inputs.  
I started from the module automatically created from the Extension Wizard and after setting vtkMRMLModelNode as the nodeType for the vtkMRMLNodeComboBox already included in the example, it works fine. However, I created a second vtkMRMLNodeComboBox with the same attributes (beside the name) underneath and that one cannot list any of the loaded models.  
Please find attached some images showing the layout and options.

 ![ComboBox1](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/6/9633d90b0d519cd28e5a0d3ee3fdfd34127344a9.png)  
 ![ComboBox2](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/6/36e9eaac491e877a9e7cc7794c5f0977f20c07e1.png)  
 ![Module](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/8/b8e6df8905040b7ad497fedcc72c5a02b66eb11f.png)

Thank you for any help

---

<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:** [June 18, 2021, 1:30pm UTC](https://discourse.slicer.org/t/cannot-get-a-second-vtkmrmlnodecombobox-to-show-nodes/18204/2 "2021-06-18T13:30:00Z")

</div>

You need to connect the MRML scene changed signal. In Qt Designer press F4 to go to signals and slots mode, then drag&drop a new signal from the very edge of your widget to the MRML node combobox.

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

Then make these selections:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/b/cbc515267330e6343bef471081bca3642ee17585.png)

---

<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:** [June 18, 2021, 1:40pm UTC](https://discourse.slicer.org/t/cannot-get-a-second-vtkmrmlnodecombobox-to-show-nodes/18204/3 "2021-06-18T13:40:31Z")

</div>

You need to set the scene into MRML widgets, such as the qMRMLNodeComboBox. We typically do this by connecting the _mrmlSceneChanged_ signal of the module widget to the _setMRMLScene_ slot of the MRML node selector widget. See details on slide 44 of the [PerkLab bootcamp Slicer programming tutorial](https://github.com/PerkLab/PerkLabBootcamp/blob/master/Doc/day3_2_SlicerProgramming.pptx):

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

---

<div class="post-metadata">

**Author:** ![atracsys-sbt](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/atracsys-sbt/32/11434_2.png) [@atracsys-sbt](https://discourse.slicer.org/u/atracsys-sbt)\
**Post date:** [June 18, 2021, 1:44pm UTC](https://discourse.slicer.org/t/cannot-get-a-second-vtkmrmlnodecombobox-to-show-nodes/18204/4 "2021-06-18T13:44:57Z")

</div>

Thank you both for your help !

---

<div class="post-metadata">

**Author:** ![WilliamDaniel](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/williamdaniel/32/13425_2.png) [@WilliamDaniel](https://discourse.slicer.org/u/WilliamDaniel)\
**Post date:** [April 2, 2022, 12:21am UTC](https://discourse.slicer.org/t/cannot-get-a-second-vtkmrmlnodecombobox-to-show-nodes/18204/5 "2022-04-02T00:21:58Z")

</div>

Hi @lassoan,  
I am a beginner learning Slicer module development.  
Now, I’d like to add a _ **qMRMLVolumeThresholdWidget** _ to my UI. However, when I try to connect the _mrmlSceneChanged_ signal to the _setMRMLScene_ slot. I found there’s seems no _setMRMLScene_ slot:

 ![Figure1](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/9/f9d9a09d12c36fbe50c5f584c530712ab918458b.png)  
Could you please tell me what to do with that?  
Thank you so much!

---

<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:** [April 2, 2022, 12:39am UTC](https://discourse.slicer.org/t/cannot-get-a-second-vtkmrmlnodecombobox-to-show-nodes/18204/6 "2022-04-02T00:39:46Z")

</div>

Enable the `Show signals and slots inherited...` checkbox. If there is still no `setMRMLScene` slot then it means that the widget does not need setting of the MRML scene, it is enough to set the volume node using `setMRMLVolumeNode`. If you connect your volume node selector’s node selected signal to the volume setting slot of the threshold widget then everything should work.
