Using Slicer Preview 5.9.0-2025-05-16
When calling a qMRMLNodeComboBox addAttribute
with 2 input arguments I observe no error however the help method indicates there should be 3 input arguments:
node_combobox = slicer.qMRMLNodeComboBox()
node_combobox.setMRMLScene(slicer.mrmlScene)
node_combobox.nodeTypes = ["vtkMRMLMarkupsLineNode"]
print(help(node_combobox.addAttribute))
Output:
Help on builtin_qt_slot:
addAttribute(...)
X.addAttribute(nodeType, attributeName, attributeValue)
None
The help()
output appears to show 1 signature with 3 input arguments, but when I only give 1 input argument it warns that it has 2 signatures that accept either 2 or 3 input arguments.Is it getting confused that qMRMLNodeFactory has an addAttribute
with 2 input arguments while qMRMLNodeComboBox has an addAttribute
with 3 input arguments?
>>> node_combobox.addAttribute("MyAttributeName")
Traceback (most recent call last):
File "<console>", line 1, in <module>
ValueError: Could not find matching overload for given arguments:
('MyAttributeName',)
The following slots are available:
addAttribute(QString nodeType, QString attributeName, QVariant attributeValue) -> void
addAttribute(QString nodeType, QString attributeName) -> void