# AttributeError: qMRMLNodeComboBox has no attribute named 'setNoneEnabled'

**URL:** <https://discourse.slicer.org/t/attributeerror-qmrmlnodecombobox-has-no-attribute-named-setnoneenabled/18365>\
**Category:** Development\
**Tags:** python, scripted\
**Created:** [June 28, 2021, 5:59am UTC](https://discourse.slicer.org/t/attributeerror-qmrmlnodecombobox-has-no-attribute-named-setnoneenabled/18365 "2021-06-28T05:59:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yihao\_Liu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/yihao_liu/32/11401_2.png) [@Yihao\_Liu](https://discourse.slicer.org/u/Yihao_Liu)\
**Post date:** [June 28, 2021, 5:59am UTC](https://discourse.slicer.org/t/attributeerror-qmrmlnodecombobox-has-no-attribute-named-setnoneenabled/18365/1 "2021-06-28T05:59:39Z")

</div>

Operating system: Ubuntu 20.04  
Slicer version: 4.11.20210226  
Expected behavior: setNoneEnabled() to disable qMRMLNodeComboBox “none” option  
Actual behavior: reported error

My code:  
…  
self.ui.fid1MRMLNodeComboBox.nodeTypes = [‘vtkMRMLMarkupsFiducialNode’]  
self.ui.fid1MRMLNodeComboBox.setNoneEnabled(False)  
…  
Bug:  
Traceback (most recent call last):  
File “/home/yl/se/TMSKuka/TMSKukaGUI/TMSKukaGUI.py”, line 92, in setup  
self.ui.fid1MRMLNodeComboBox.setNoneEnabled(False)  
AttributeError: qMRMLNodeComboBox has no attribute named ‘setNoneEnabled’  
Slicer Docs:  
[https://apidocs.slicer.org/master/qMRMLNodeComboBox\_8h\_source.html](https://apidocs.slicer.org/master/qMRMLNodeComboBox_8h_source.html)  
[https://apidocs.slicer.org/master/classqMRMLNodeComboBox.html#a60aadef87aa219043a0177780f22d855](https://apidocs.slicer.org/master/classqMRMLNodeComboBox.html#a60aadef87aa219043a0177780f22d855)

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [June 28, 2021, 11:18am UTC](https://discourse.slicer.org/t/attributeerror-qmrmlnodecombobox-has-no-attribute-named-setnoneenabled/18365/2 "2021-06-28T11:18:37Z")

</div>

From Python this property “noneEnabled” is set directly. You can find examples of its usage in python by searching the Slicer GitHub repo.

> **[Slicer/Slicer](https://github.com/Slicer/Slicer/search?l=Python&q=noneEnabled&type=)**
>
> Multi-platform, free open source software for visualization and image computing. - Slicer/Slicer

```python
self.ui.fid1MRMLNodeComboBox.noneEnabled = False

```

---

<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 28, 2021, 3:13pm UTC](https://discourse.slicer.org/t/attributeerror-qmrmlnodecombobox-has-no-attribute-named-setnoneenabled/18365/3 "2021-06-28T15:13:24Z")

</div>

You may find useful this [documentation page](https://slicer.readthedocs.io/en/latest/developer_guide/api.html#doxygen-style-documentation), which describes how to read doxygen-generated documentation in Python.

---

<div class="post-metadata">

**Author:** ![Yihao\_Liu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/yihao_liu/32/11401_2.png) [@Yihao\_Liu](https://discourse.slicer.org/u/Yihao_Liu)\
**Post date:** [June 28, 2021, 3:26pm UTC](https://discourse.slicer.org/t/attributeerror-qmrmlnodecombobox-has-no-attribute-named-setnoneenabled/18365/4 "2021-06-28T15:26:58Z")

</div>

Thank you for your reply. Yes I tried it and it worked.

---

<div class="post-metadata">

**Author:** ![Yihao\_Liu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/yihao_liu/32/11401_2.png) [@Yihao\_Liu](https://discourse.slicer.org/u/Yihao_Liu)\
**Post date:** [June 28, 2021, 3:27pm UTC](https://discourse.slicer.org/t/attributeerror-qmrmlnodecombobox-has-no-attribute-named-setnoneenabled/18365/5 "2021-06-28T15:27:30Z")

</div>

Thank you very much! This is very helpful. I should have seen this earlier.
