mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-22 05:26:29 +02:00
[core] Handle attribute valueChanged callback at the Node level
Move the attributeChanged callback logic within Node, as this is a Node level mecanism (callbacks being declared on the node desc). This commit also moves the attribute valueChanged signal outside of the Attribute's constructor. This seems to be the root cause to undesired side-effects breaking Qt's evaluation system, data model access and consequently Meshroom's UI.
This commit is contained in:
parent
e73e8f2fd7
commit
7fdb5cc734
2 changed files with 35 additions and 15 deletions
|
@ -25,11 +25,14 @@ def attributeFactory(description, value, isOutput, node, root=None, parent=None)
|
|||
root: (optional) parent Attribute (must be ListAttribute or GroupAttribute)
|
||||
parent (BaseObject): (optional) the parent BaseObject if any
|
||||
"""
|
||||
attr = description.instanceType(node, description, isOutput, root, parent)
|
||||
attr: Attribute = description.instanceType(node, description, isOutput, root, parent)
|
||||
if value is not None:
|
||||
attr._set_value(value, emitSignals=False)
|
||||
else:
|
||||
attr.resetToDefaultValue(emitSignals=False)
|
||||
|
||||
attr.valueChanged.connect(lambda attr=attr: node._onAttributeChanged(attr))
|
||||
|
||||
return attr
|
||||
|
||||
|
||||
|
@ -67,7 +70,6 @@ class Attribute(BaseObject):
|
|||
self._value = None
|
||||
self.initValue()
|
||||
|
||||
self.valueChanged.connect(self.onChanged)
|
||||
|
||||
@property
|
||||
def node(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue