Call parent __init__ as soon as possible for CtrlNode

This commit is contained in:
2xB 2019-06-30 17:50:11 +02:00
parent 23b4e174f0
commit a4cecf4a22

View File

@ -91,14 +91,15 @@ class CtrlNode(Node):
sigStateChanged = QtCore.Signal(object)
def __init__(self, name, ui=None, terminals=None):
if terminals is None:
terminals = {'In': {'io': 'in'}, 'Out': {'io': 'out', 'bypass': 'In'}}
Node.__init__(self, name=name, terminals=terminals)
if ui is None:
if hasattr(self, 'uiTemplate'):
ui = self.uiTemplate
else:
ui = []
if terminals is None:
terminals = {'In': {'io': 'in'}, 'Out': {'io': 'out', 'bypass': 'In'}}
Node.__init__(self, name=name, terminals=terminals)
self.ui, self.stateGroup, self.ctrls = generateUi(ui)
self.stateGroup.sigChanged.connect(self.changed)