Skip to content

Commit ac3ab4c

Browse files
committed
Fix setCurrentIndex error
AttributeError: 'builtin_function_or_method' object has no attribute 'setCurrentIndex'
1 parent 9635181 commit ac3ab4c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

example_auto_nodes/node_base/module_node.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ def __init__(self, defaultInputType=None, defaultOutputType=None):
5454
self.add_output('output')
5555
self.create_property('output', None)
5656

57-
self.view.widgets['funcs'].widget.setCurrentIndex(0)
58-
self.add_function(None, self.view.widgets['funcs'].widget.currentText())
57+
self.view.widgets['funcs'].get_custom_widget().setCurrentIndex(0)
58+
self.add_function(
59+
None, self.view.widgets['funcs'].get_custom_widget().currentText())
5960

6061
def is_function(self, obj):
6162
if inspect.isfunction(self.func) or inspect.isbuiltin(self.func):

example_nodes/math_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(self):
3232
self.create_property('output', None)
3333
self.trigger_type = 'no_inPorts'
3434

35-
self.view.widgets['funcs'].widget.setCurrentIndex(2)
35+
self.view.widgets['funcs'].get_custom_widget().setCurrentIndex(2)
3636

3737
def addFunction(self, prop, func):
3838
"""

0 commit comments

Comments
 (0)